Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Compilation error after converting Sample 2.0 database Nwind.mdb


View products that this article applies to.

This article was previously published under Q208782
Moderate: Requires basic macro, coding, and interoperability skills.

↑ Back to the top


Symptoms

When you convert the Microsoft Access 2.0 sample database, NWIND.MDB, to Microsoft Access 2000, you may receive the following error message:
There were compilation errors during the conversion or enabling of this database.

↑ Back to the top


Cause

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

NWIND.MDB uses an identifier called Event in the ShowEvent procedure of the Utility Functions module, and this causes the compile error.

↑ Back to the top


Resolution

After you convert NWIND.MDB to Access 2000, follow these steps 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. In the Visual Basic Editor, on the Debug menu, click Compile NWIND.
  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 NWIND.

↑ Back to the top


More information

Steps to reproduce problem

  1. Start Access 2000 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 message during conversion:
    There were compilation errors during the conversion or enabling of this database.

↑ Back to the top


References

For more information about reserved keywords in Microsoft Access, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type scoping levels in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB208782, kbprb, kberrmsg

↑ Back to the top

Article Info
Article ID : 208782
Revision : 3
Created on : 8/4/2004
Published on : 8/4/2004
Exists online : False
Views : 289