INFO: AbsolutePosition Property with JET Databases in ADOID: Q194607
|
The AbsolutePosition Property in ADO returns a -1 if the Cursorlocation property is set to adUseServer, the ADO default. This is essentially saying that the AbsolutePosition is unknown, adPositionUnknown.
Setting the CursorLocation property of the ADO recordset object to
adUseClient corrects this problem.
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security " & _
"Info=False;Data Source=C:\Program Files\Microsoft Visual " & _
"Studio\VB98\Nwind.mdb"
' Uncomment the below line to change AbsolutePosition value
'rs.CursorLocation = adUseClient
rs.Open "select * from employees", cn, adOpenKeyset
Debug.Print "There are " & rs.RecordCount & " records in employees"
Debug.Print "AbsolutePosition is " & rs.AbsolutePosition
For more information about ActiveX Data Objects (ADO) visit the Universal
Data Access Web site at the following address:
http://www.microsoft.com/data/
Additional query words: kbADO200 kbVBp600 kbMDAC200 kbdse
Keywords : kbADO200
Version : WINDOWS:1.5,2.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: March 12, 1999