Microsoft KB Archive/286341

From BetaArchive Wiki

Article ID: 286341

Article Last Modified on 1/12/2007



APPLIES TO

  • Microsoft Access 2002 Standard Edition



This article was previously published under Q286341

This article applies only to a Microsoft Access database (.mdb).

For a Microsoft Access 95 and 97 version of this article, see 141296.

For a Microsoft Access 2000 version of this article, see 208645.


SUMMARY

When you convert a Microsoft Access 1.x or a Microsoft Access 2.0 database to Microsoft Access 2002, the conversion process may display a warning message or stop altogether because of an incompatibility with the new features and enhancements.

This article discusses general troubleshooting tips for the unusual case when Microsoft Access cannot successfully convert a database.

MORE INFORMATION

You cannot directly convert a Microsoft Access 1.x database to Access 2002. If you want to convert an Access 1.x database to Access 2002, you must first convert the 1.x database to Access 2.0, Access 7.0, or Access 97, and then convert the new database to Access 2002.

You can directly convert a Microsoft Access 2.0 database to Access 2002. However, after you convert the Access 2.0 database, you may encounter various compile errors when you try to use the database in Access 2002.

Compile errors

During the conversion, you may receive an error message similar to the following:

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

If you receive this or a similar error message, compile all modules in the converted database. The converted database may have changes in syntax from Access 2.0 that you must manually change. In rare instances, the conversion utility may fail to convert some Access Basic programming code to Visual Basic for Applications. For example, it may fail to modify a DoCmd statement, such as:

DoCmd OpenForm "MyForm"
                

into a method of the DoCmd object:

DoCmd.OpenForm "MyForm"
                

To compile all modules in a converted database, follow these steps:

  1. Open the converted database in the Access 2002.
  2. Open a module in Design view.
  3. On the Debug menu, click Compile database name. As Microsoft Access compiles your code, it stops at any command line that contains an error.
  4. Correct the syntax to resolve the compilation error, and then repeat these steps until there are no further compilation errors.

Import objects

If the conversion process appears to stop, takes a long time to complete, or displays an error that prevents the new database from being created, you can create a new database in Access 2002, and then import objects (individually or grouped) from the Access 2.0 database.

Importing objects into a new database has two benefits:

  • You can determine which objects are incompatible with Access 2002. If an object fails to import, you know that you need to examine it more closely for a potential incompatibility. If an object imports successfully, it is automatically converted to the new version, with the exception of code. Code that is imported is not converted to the new syntax. You have to make changes to the syntax manually.
  • You can speed the conversion process by importing groups of objects. If you have a large database, the conversion process may be slow or may appear to cause your computer to stop responding. Importing groups of objects requires less memory and in some cases may be faster.

To use the Import command instead of the Convert Database command, follow these steps:

  1. Create a new Microsoft Access 2002 database.
  2. On the File menu, point to Get External Data, and then click Import.
  3. In the Import dialog box, click the arrow in the Files of type box, and then click Microsoft Access in the list.
  4. In the Look in box, select the drive and the folder where the Microsoft Access database (.mdb) is located, and then double-click the database.
  5. Select one or more objects to import, and then click OK to import the selected objects.
  6. Repeat these steps until all the objects are imported into the new database.

Reducing Errors

To help reduce errors during the conversion process:

  • Recompile all modules in the Microsoft Access 2.0 database in Microsoft Access 2.0, and then convert the database to the new version. This practice eliminates any pre-existing compilation errors that result in error messages when you convert the database to the new version.


This may require you to reinstall Microsoft Access 2.0 if you installed Microsoft Access 2002 into the same folder (directory) as Access 2.0. You may want to reinstall Microsoft Access 2.0 into a different folder so that you have both versions available for resolving any conversion problems.

  • Open the database in Microsoft Access 2.0, and then look for incompatibilities, such as modules called "DAO," "Access," or some other type of existing library name.


REFERENCES

For more information about database conversion and compatibility, click Microsoft Access Help on the Help menu, type about converting an access file in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Keywords: kbhowto KB286341