Is there anyway to retrieve the current record position of an ADODB recordset? When I use an ADODC control on the form I can say:
Label1.Caption = ADODC.Recordset.AbsolutePosition
and it will return the current record it's on. When I use a design time database ADODB.Recordset the AbsolutePosition never changes from -1. ex:
------------
Dim adoConn as New ADODB.Connection, rs as ADODB.Recordset
Dim ConnString as String, SQLString as string
ConnString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=" & Chr(34) & "DBQ=c:\PhysTrack.mdb;DefaultDir=C:\;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=c:\phystrack.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;" & Chr(34)
SQLString = "Select * From Doctor"
adoConn.Open ConnString
rs.Open SQLString, adoConn, adOpenStatic, adLockBatchOptimistic, (adCmdText + adAsyncFetchNonBlocking)
if rs.EOF = False then
Label1.Caption = rs.AbsolutePosition
end if
rs.close
adoconn.close
set rs = nothing
set adoconn = nothing
---------
I always get -1 as my absolute position. I've tried movefirst, movelast, etc. I don't want to have to have a variable and increment to keep track of what record I'm on. A bit tedious. Any help on this would be greatly appreciated!
Label1.Caption = ADODC.Recordset.AbsolutePosition
and it will return the current record it's on. When I use a design time database ADODB.Recordset the AbsolutePosition never changes from -1. ex:
------------
Dim adoConn as New ADODB.Connection, rs as ADODB.Recordset
Dim ConnString as String, SQLString as string
ConnString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=" & Chr(34) & "DBQ=c:\PhysTrack.mdb;DefaultDir=C:\;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=c:\phystrack.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;" & Chr(34)
SQLString = "Select * From Doctor"
adoConn.Open ConnString
rs.Open SQLString, adoConn, adOpenStatic, adLockBatchOptimistic, (adCmdText + adAsyncFetchNonBlocking)
if rs.EOF = False then
Label1.Caption = rs.AbsolutePosition
end if
rs.close
adoconn.close
set rs = nothing
set adoconn = nothing
---------
I always get -1 as my absolute position. I've tried movefirst, movelast, etc. I don't want to have to have a variable and increment to keep track of what record I'm on. A bit tedious. Any help on this would be greatly appreciated!