ACC97: Compilation Error After Converting NWIND.MDB in Access 97

Last reviewed: May 21, 1997
Article ID: Q160500
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

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

When you convert the Microsoft Access 2.0 sample database NWIND.MDB to Microsoft Access 97, you receive the following error message:

   There were compilation errors during the conversion or enabling of this
   database.

CAUSE

Microsoft Access 97 supports some new Visual Basic keywords, and you cannot use those keywords as identifiers in your database. The keywords are: AddressOf, Decimal, DefDec, Enum, Event, Friend, Implements, RaiseEvent, WithEvents. When you convert a database from an earlier version of Microsoft Access to Microsoft Access 97, existing identifiers that are the same as new Visual Basic keywords cause a compile error.

In this example, NWIND.MDB uses an identifier called Event in the ShowEvent procedure of the Utility Functions module.

RESOLUTION

After you convert NWIND.MDB to Microsoft Access 97, do the following to fully compile the project:

  1. Start Microsoft Access and open the converted NWIND.MDB.

  2. Open the Utility Functions module in Design view.

  3. On the Debug menu, click Compile Loaded Modules.

  4. Click OK when you receive the compile error message.

  5. Modify the ShowEvent procedure to read as follows:

          Sub ShowEvent (Event_var As String)
          ' Accepts: a text value, the type or name of an object and the name
          ' of an event.
          ' Purpose: displays an event history list in the Event History form.
    
             If IsNull(Forms![Event History]![History]) Then
                Forms![Event History]![History] = Event_var
             Else
                Forms![Event History]![History] = Event_var & Chr(13) & _
                   Chr(10) & Forms![Event History]![History]
             End If
          End Sub
    
    

  6. On the Debug menu, click Compile and Save All Modules.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access 97 and open the Microsoft Access 2.0 sample database NWIND.MDB.

  2. In the Convert/Open Database dialog box, click Convert Database. Note that you receive the following warning message during conversion:

          There were compilation errors during the conversion or enabling of
          this database.
    

REFERENCES

For more information about reserved keywords in Microsoft Access 97, search the Help Index for "scoping levels," and then view the topic "Scoping and Object-Naming Compatibility."


Keywords : CnvProb kberrmsg kbusage MdlProb PgmErr
Version : 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


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: May 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.