Description:
When an ADO record set is opened with a server side / forward only cursor (the only option), and RecordSet.Move 95 is called, the script crashes. Calling it with any number less than that succeeds. If the RS is opened as client side / static, the script will also succeed up to the maximum number of records in the table.
This problem doesn't seem to exist with the 5.0 driver, only 3.51. The bug is demostrated in attached file bug.vbs, and runs in the ADO conformance test/Script Unit test framework. Modify the value on line 89 to cause the test to pass or fail.
How to repeat:
Sub TestExecuteValidServer()
Dim connection1, recset1, strSQL
Dim iTestRow, iTestCol, testVal, i, j
Set connection1 = CreateObject("ADODB.Connection")
Set recset1 = CreateObject("ADODB.RecordSet")
connection1.ConnectionString = connstr
'If used with adUseClient / adOpenStatic then this works...
connection1.CursorLocation = CInt(adUseServer)
connection1.Open
strSQL = "SELECT * FROM ado_test"
' open recordset
recset1.Open strSQL, connection1, adOpenForwardOnly
recset1.MoveFirst
iTestRow = 94 ' there are 100 total records in this test table. if this number is set to 94 or less then the test passes.
' Jump to the test row
recset1.Move (iTestRow)
MsgBox "first field value from record: " & recset1.Fields(0).Value
Call Cleanup (connection1, recset1)
End Sub