Bug #25902 MyODBC ADO recset with client side cursor is lost after a given # of recs read
Submitted: 29 Jan 2007 0:28 Modified: 12 Jun 2007 10:45
Reporter: Erica Moss Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.12 OS:Windows (XP)
Assigned to: Mark Matthews CPU Architecture:Any

[29 Jan 2007 0:28] Erica Moss
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
[29 Jan 2007 0:28] Erica Moss
script unit test fle

Attachment: bug.vbs (application/octet-stream, text), 2.53 KiB.

[12 Jun 2007 10:45] Georg Richter
Can't repeat. Tested with ODBC v 3.51.15