bsams
05-14-2003, 09:05 AM
I'm having a hard time getting .recordcount and .absoluteposition to give me anything other than -1. I have a status bar and want one of the cells to show 'Record x of x' when I navigate my recordset. Here's the code I have (the msgbox is just for debugging purposes):
Dim myConnection As ADODB.Connection
Dim myRecordset As ADODB.Recordset
Set myConnection = New ADODB.Connection
Set myRecordset = New ADODB.Recordset
myConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & dbPath
myRecordset.Open "SELECT * FROM Customers", myConnection, adOpenDynamic, adLockOptimistic, adCmdText
myRecordset.MoveLast
msgbox myRecordset.recordcount
Dim myConnection As ADODB.Connection
Dim myRecordset As ADODB.Recordset
Set myConnection = New ADODB.Connection
Set myRecordset = New ADODB.Recordset
myConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & dbPath
myRecordset.Open "SELECT * FROM Customers", myConnection, adOpenDynamic, adLockOptimistic, adCmdText
myRecordset.MoveLast
msgbox myRecordset.recordcount