The information in this article applies to:
SYMPTOMS
While debugging your code that uses Automation to control Microsoft Access,
you may receive one of the following errors.
-or- When automating Microsoft Access 97: This problem only occurs when you run your code in Break mode (Debug mode). CAUSEThe cause of the problem depends on the version of Microsoft Access that you are automating. In Microsoft Access 95When automating Microsoft Access 95, this problem may occur when all of the following conditions apply:
Microsoft Access 97When automating Microsoft Access 97, this problem may occur when all of the following conditions apply:
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. MORE INFORMATIONThe following examples show how to reproduce this problem under each version of Microsoft Access. A workaround is provided for each example. Microsoft Access 95
You should establish a reference to the "Microsoft Access for Windows 95"
library in your project before running the code. When you run this
procedure and get to the Stop statement, which enters Break mode, switch
over to Microsoft Access and close the startup form if it is open. Then
switch back to your code and press F8 to continue past the Stop statement
and again past the End Sub.
Result: Microsoft Access will close automatically because the object variables lose scope and no forms and reports are open in the database. This is by design. However, you then receive an Invalid Page Fault error. REFERENCESFor additional information, please see the following articles in the Microsoft Knowledge Base: Q147816 ACC: Using Microsoft Access as an Automation Server WORKAROUNDSet all procedure-level form and report object variables to Nothing before ending the procedure. For this example, add the following lines at the end of the procedure:
Microsoft Access 97
Be sure to establish a reference to the "Microsoft Access 8.0 Object
Library" in your project before running the code. When you run this
procedure and get to the Stop statement, which enters Break mode, press F8
to continue to the MsgBox line.
Result: An Invalid Page Fault error occurs, causing the client application to terminate. Dim all procedure-level form and report object variables as Object. For this example, Dim objForm as Object instead of Access.Form. Another workaround is to Dim the variable as Access.Form at the module level. Additional query words: access violation gpf crash
Keywords : kberrmsg kbAccess97 kbAutomation KbVBA |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |