I have an ODBC connection from an ACCESS database to a MYSQL database. One of the tables contains just over 5 million records. If I try to count the records using the code below, I get a message box with 'Overflow' text and an OK button.
If I try to display the records by double clicking the table name, I get some records displayed but no count in the record selector at the bottom of the display. If I move the right hand scroll down I get more records. If I navigate to the last record I do end up with the total number of records. It looks like the dataset view can handle looking at some of the records.
Is there some environmental setting or parameter I can change or can you suggest an alternative approach?
Private Sub cmbOverallUsage_Click()
On Error GoTo Err_cmdOverallUsage_Click
Dim cnn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim counter As Integer
Set cnn = CurrentProject.Connection
rst.Open "SELECT * FROM variableLog", cnn, adOpenKeyset, adLockOptimistic
counter = rst.RecordCount
MsgBox "Count= '" & counter & "'"
Exit_cmdOverallUsage_Click:
Exit Sub
Err_cmdOverallUsage_Click:
MsgBox Err.Description
Resume Exit_cmdOverallUsage_Click
End Sub
If I try to display the records by double clicking the table name, I get some records displayed but no count in the record selector at the bottom of the display. If I move the right hand scroll down I get more records. If I navigate to the last record I do end up with the total number of records. It looks like the dataset view can handle looking at some of the records.
Is there some environmental setting or parameter I can change or can you suggest an alternative approach?
Private Sub cmbOverallUsage_Click()
On Error GoTo Err_cmdOverallUsage_Click
Dim cnn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim counter As Integer
Set cnn = CurrentProject.Connection
rst.Open "SELECT * FROM variableLog", cnn, adOpenKeyset, adLockOptimistic
counter = rst.RecordCount
MsgBox "Count= '" & counter & "'"
Exit_cmdOverallUsage_Click:
Exit Sub
Err_cmdOverallUsage_Click:
MsgBox Err.Description
Resume Exit_cmdOverallUsage_Click
End Sub