ACC2: Incorrect FindFirst Example in "Building Applications"

Last reviewed: April 2, 1997
Article ID: Q121838
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

Page 256 of the Microsoft Access version 2.0 "Building Applications" manual contains an example of using the FindFirst and FindNext methods to locate all records satisfying a particular criterion. However, if you re-create and run this example, you will receive the following error message:

   Invalid Operation.

CAUSE

This error occurs because the example contains an error. The example uses the OpenRecordset method to open the Employees table as a table-type Recordset object, but the FindFirst method is not available with table-type Recordset objects.

RESOLUTION

Change the line in the example that reads

   Set MySet=MyDB.OpenRecordset("Employees")

to the following line:

   Set MySet=MyDB.OpenRecordset("Employees",DB_OPEN_DYNASET)

STATUS

This behavior no longer occurs in Microsoft Access version 7.0.

REFERENCES

For more information about the OpenRecordset method, search for "OpenRecordset," and then "OpenRecordset Method (Data Access)" using the Microsoft Access Help menu.

Microsoft Access "Building Applications," version 2.0, Chapter 11, "Working with Sets of Records," pages 256-257

For more information about documentation corrections, view the topic "Documentation Updates" in the Microsoft Access 2.0 ACREADME.HLP file.


Additional query words: kberrmsg
Keywords : DcmMnl kbusage
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.