Description:
This problem was found while running the ADO compliance test:
level1/rsmaxrecords_vbs.TestExecuteValidClient()
This test runs fine against MyODBC 3.51.14
After setting the recset.MaxRecords property to some value less than the total number of records in a table, and then executing SELECT * from that table, the total number of records is equal to the value of recset.MaxRecords
However when run against MyODBC 5.0.12, the total number of records in the record set==the total number of records in the table. It was verified that the value of MaxRecords was actually set to the requested value, however it doesn't have the desired effect.
How to repeat:
VBScript: see the full test suite in SVN, to run this in the framework
Sub TestExecuteValidClient()
On Error Resume Next
Dim connection1, recset1, strSQL, fld, iRecordCount
Set connection1 = CreateObject("ADODB.Connection")
Set recset1 = CreateObject("ADODB.RecordSet")
' open connection
connection1.ConnectionString = connstr
connection1.CursorLocation = adUseClient
connection1.Open
strSQL = "SELECT * FROM ado_test"
' Open the recordset
recset1.Open strSQL, connection1, adOpenForwardOnly, adCmdText
iRecordCount = recset1.RecordCount
recset1.MoveFirst
If iRecordCount <> -1 Then
If iRecordCount = 0 Then
Call Cleanup (connection1, recset1)
On Error Goto 0
Assert.Failure "There are no records in the test table"
Exit Sub
End If
Else
' the record count property isn't supported so have to find out the max num of records another way
dim iTemp: iTemp = 0
while NOT recset1.EOF
recset1.MoveNext
iTemp = iTemp + 1
wend
iRecordCount = iTemp
End If
recset1.Close
' Start Test
recset1.LockType = adLockReadOnly
recset1.MaxRecords = iRecordCount - 75
' open recordset
recset1.Open strSQL, connection1, adOpenForwardOnly, adCmdText
iTemp = 0
Do While Not recset1.EOF
recset1.MoveNext
iTemp = iTemp + 1
Loop
If iTemp <> iRecordCount - 75 Then
Call Cleanup (connection1, recset1)
On Error Goto 0
Assert.Failure "The number of records returned didn't equal the MaxRecords Property"
Exit Sub
End If
Call Cleanup (connection1, recset1)
End Sub
Description: This problem was found while running the ADO compliance test: level1/rsmaxrecords_vbs.TestExecuteValidClient() This test runs fine against MyODBC 3.51.14 After setting the recset.MaxRecords property to some value less than the total number of records in a table, and then executing SELECT * from that table, the total number of records is equal to the value of recset.MaxRecords However when run against MyODBC 5.0.12, the total number of records in the record set==the total number of records in the table. It was verified that the value of MaxRecords was actually set to the requested value, however it doesn't have the desired effect. How to repeat: VBScript: see the full test suite in SVN, to run this in the framework Sub TestExecuteValidClient() On Error Resume Next Dim connection1, recset1, strSQL, fld, iRecordCount Set connection1 = CreateObject("ADODB.Connection") Set recset1 = CreateObject("ADODB.RecordSet") ' open connection connection1.ConnectionString = connstr connection1.CursorLocation = adUseClient connection1.Open strSQL = "SELECT * FROM ado_test" ' Open the recordset recset1.Open strSQL, connection1, adOpenForwardOnly, adCmdText iRecordCount = recset1.RecordCount recset1.MoveFirst If iRecordCount <> -1 Then If iRecordCount = 0 Then Call Cleanup (connection1, recset1) On Error Goto 0 Assert.Failure "There are no records in the test table" Exit Sub End If Else ' the record count property isn't supported so have to find out the max num of records another way dim iTemp: iTemp = 0 while NOT recset1.EOF recset1.MoveNext iTemp = iTemp + 1 wend iRecordCount = iTemp End If recset1.Close ' Start Test recset1.LockType = adLockReadOnly recset1.MaxRecords = iRecordCount - 75 ' open recordset recset1.Open strSQL, connection1, adOpenForwardOnly, adCmdText iTemp = 0 Do While Not recset1.EOF recset1.MoveNext iTemp = iTemp + 1 Loop If iTemp <> iRecordCount - 75 Then Call Cleanup (connection1, recset1) On Error Goto 0 Assert.Failure "The number of records returned didn't equal the MaxRecords Property" Exit Sub End If Call Cleanup (connection1, recset1) End Sub