How to use command line switch /convert to convert database only into Access 2000 file format (319253)



The information in this article applies to:

  • Microsoft Access 2002

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

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

SYMPTOMS

The Microsoft Access 2002 "Startup command-line options" Help topic incorrectly states the following:

Converts a previous-version Access database or Access project to the default file format, renames the new file, and then closes Access. You must specify the source database before you use the /convert option. To view the default file format, click Options on the Tools menu, and then click the Advanced tab.

CAUSE

The /convert switch cannot detect the DefaultDatabaseFormat property. In Access 2002, the switch can convert the database only into Access 2000 file format.

RESOLUTION

If you want to convert a previous version of an Access database into Access 2002 file format, use one of the following methods.

Using the Built-in Access Menus

On the Tools menu, point to Database Utilities, point to Convert Database, and then click To Access 2002 File Format.

Using the ConvertAccessProject Method

The following code converts a previous version of an Access database into Access 2002 file format:
  1. Create a module, and then type the following line in the Declarations section if it is not already there:
    Option Explicit
    						
  2. Type the following procedure:
    Function ConvDB2002(SourceDb As String, DestDb As String)
       Application.ConvertAccessProject SourceDb, DestDb, acFileFormatAccess2002
    End Function
    						
  3. To test this function, type the following line in the Immediate window. Make sure to substitute the correct path and file name for your database. Then, press ENTER:
    ?ConvDB2002("c:\data\MyAcc97.mdb", "c:\data\MyAcc2002.mdb")
    						
For more information about the ConvertAccessProject method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type ConvertAccessProject Method in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For additional information about how to convert multiple Access databases, click the article number below to view the article in the Microsoft Knowledge Base:

304318 ACC2002: How to Programmatically Convert Multiple Access Databases

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

To set the DefaultDatabaseFormat property, click Options on the Tools menu, and then click the Advanced tab.

REFERENCES

For more information about command line switches, click Microsoft Access Help on the Help menu, type startup command-line options in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MinorLast Reviewed:8/11/2004
Keywords:kbhowto kbdocerr kbdta kbnofix KB319253