Programatically revert to previous version

greaseman

Closer to seniority!
Local time
Yesterday, 19:16
Joined
Jan 6, 2003
Messages
360
I know how to convert an Access database from a previous version of Access to a higher version of Access, using the shell command:

x = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE " & Chr(34) & strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb & Chr(34))

However, what do I have to do to programatically revert from my current version of Access to a previous version? Is there a shell option similar to the /CONVERT choice? It would be nice if it was as simple as /REVERT

Thanks once more to you forum gurus!
 
Search the Access help files for the ConvertAccessProject Method. I have never used it. But I found it by using the built in search feature in the VB window of Access 2003 and searched for the keywords "convert access" and low and behold I think I found what you are seeking. ;)

Code:
[I]Converts the specified Microsoft Access file from one version to another.

expression.ConvertAccessProject(SourceFilename, DestinationFilename, DestinationFileFormat)
expression    Required. An expression that returns one of the objects in the Applies To list.

SourceFilename   Required String. The name of the Access file to convert. If a path isn't specified, Access looks for the file in the current directory.

DestinationFilename   Required String. The name of the file where Access saves the converted file. If a path isn't specified, Access saves the file in the current directory.

DestinationFileFormat   Required AcFileFormat. The Access version of the converted file.

AcFileFormat can be one of these AcFileFormat constants. 
acFileFormatAccess2 
acFileFormatAccess2000 
acFileFormatAccess2002 
acFileFormatAccess95 
acFileFormatAccess97 

Remarks
The file specified by DestinationFilename cannot already exist, or an error occurs.

Example
The following example converts the specified Access 97 file to an Access 2000 file in the same directory.

Application.ConvertAccessProject _
    SourceFilename:="C:\My Documents\Sales-Access97.mdb", _
    DestinationFilename:="C:\My Documents\Sales-Access2000.mdb", _
    DestinationFileFormat:=acFileFormatAccess2000[/I]
 
ghudson,

Thanks for your suggestion...however, I'm running Access 2000, and I could not find anything within Access 2000 or my help files related to what you suggested. Do you kow if your suggestion is new to AC 2003? Is there maybe an equivalent in AC 2000?

Thanks again!
 
If you can not use the Application.ConvertAccessProject method then it must be new to Access 2003. I have never used it but I was intrigued when I saw this post.
 

Users who are viewing this thread

Back
Top Bottom