Article ID: 186267
Article Last Modified on 3/2/2005
strSQL = "SELECT * FROM Customers"
rsCustomers.MaxRecords = 10
rsCustomers.Open strSQL, cnNWind, adOpenStatic
MsgBox rsCustomers.RecordCount & " records returned using MaxRecords."
Use this code:
strSQL = "SELECT TOP 10 * FROM Customers" rsCustomers.Open strSQL, cnNWind, adOpenStatic MsgBox rsCustomers.RecordCount & " records returned using TOP syntax."With the first snippet of code, you should see that the MaxRecords property does not affect the number of records returned by the query. The second snippet of code should return only ten records.
Keywords: kbdatabase kbjet kbdcom kbprb kbmdacnosweep KB186267