The information in this article applies to:
SYMPTOMSUsing the MaxRecords property of an ADO Recordset object does not affect the number of records returned in queries against Microsoft Access databases. CAUSEThe MaxRecords property depends on functionality exposed by the underlying OLE DB provider or ODBC driver to limit the number of rows returned by the query. This functionality is optional for ODBC drivers and OLE DB providers. The Microsoft Access ODBC driver and Jet OLEDB provider do not expose this functionality. This behavior may occur for other OLE DB providers and ODBC drivers as well. RESOLUTIONIf you want to limit the number of records returned in a query against a Microsoft Access database, use the TOP syntax in the query string rather than the Recordset's MaxRecords property. STATUSThis behavior is by design. MORE INFORMATIONSteps to Reproduce BehaviorInstead of using the following code:
Use this code:
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.
Additional query words:
Keywords : kbADO kbDatabase kbDCOM kbJET kbMTS kbODBC kbOLEDB kbVBp600 kbGrpVBDB kbGrpMDAC kbADO210sp2 kbMDAC210SP2 |
Last Reviewed: November 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |