Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change DB format programatically (Access97 / 2000 and later)

    Is it possible to change the format of an Access97 database to Access 2000 or later programatically. The database contains tables only.

    I could accomplish this (I think) with automation and a blank database but I am looking for a simple ADO or DAO command if possible.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change DB format programatically (Access97 / 2000 and later)

    The Application object has a ConvertAccessProject method in Access 2000 or higher.

    Application.ConvertAccessProject _
    SourceFilename:="C:My DocumentsSales97.mdb", _
    DestinationFilename:="C:My DocumentsSales2000.mdb", _
    DestinationFileFormat:=acFileFormatAccess2000

    The third argument can be:

    acFileFormatAccess2
    acFileFormatAccess95
    acFileFormatAccess97
    acFileFormatAccess2000
    acFileFormatAccess2002

    Alternatively, you can start another instance of Access with the /Convert option using Shell. This converts to Access 2000 format only, even in Access 2002:

    strOldDb = "C:My DocumentsSales97.mdb"
    strNewDb = "C:My DocumentsSales200.mdb"
    Shell("C:Program FilesMicrosoft OfficeOffice10MSACCESS.EXE " & Chr(34) & strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb & Chr(34))

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change DB format programatically (Access97 / 2000 and later)

    Many thanks.
    I have also just come across the CompactDatabase of the JetReplicationObject which should also do the job

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change DB format programatically (Access97 / 2000 and later)

    Be careful: the Access 2000 and 2002 database formats are different, but both are based on Jet 4.0. I don't think that the Jet engine knows the difference between 2000 and 2002.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Change DB format programatically (Access97 / 2000 and later)

    Compact doesn't change the file format in 2000 or 2002. If the file is a 2000 format file, it's compacted into 2000 format, regardless. You do NOT want to use compact to change the format. <img src=/S/nope.gif border=0 alt=nope width=15 height=15>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •