Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TransferDatabase (Access 2000)

    My Acccess database is split into a codes-only front-end, and a data-only back-end. For use on a legacy dBase III+ program, I need to export a table in the back-end to a dBase III+ file.

    I use the following code:

    DoCmd.TransferDatabase acExport, "dBase III", "Backend_Path:Backend.mdb", acTable, "tblBackEnd", "dB3_File.dbf"

    I got the error message that "Backend_Path:Backend.mdb" was not a valid path. However, if the table was created in the front-end, and "Backend_Path:Backend.mdb" was replaced by "Frontend_Path:FrontEnd.mdb" or just the front-end path, DoCmd.TransferDatabase worked fine and the dBase file was correctly created. However, I would prefer the table stays in the back-end.

    Does it mean that acExport in DoCmd.TransferDatabase works only with tables present in the front-end?

    Please help.

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

    Re: TransferDatabase (Access 2000)

    When you are exporting to DBase, the 3rd argument to DoCmd.TransferDatabase is the path (folder) of the file to be exported. It is not the name of an Access database; DoCmd.TransferDatabase can only export from the currently active database. You can, however, create a link in your frontend to the table in the backend. Exporting the link from the frontend will have the same effect as exporting the table itself from the backend. The alternative would be to create a second instance of Access in code, open the backend database in it. and export the table.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TransferDatabase (Access 2000)

    Thanks HansV for your reminder on TransferDatabase. I have to accept the newly created table into my front-end [img]/forums/images/smilies/smile.gif[/img] One of the reasons is I have to rename some of the fields to be used in the legacy application before TrenasferDatabase, and it is easier to do so in the active database.

    The main reason I don't want to touch my front-end is to prevent it from bloating up. I can compact and repair the back-end from my front-end, but I can't do the same to my front-end without doing it externally.

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

    Re: TransferDatabase (Access 2000)

    As I mentioned, you could start a second instance of Access using Automation, and open the backend database in it as current database. You can do everything in the backend.

    Dim app As Access.Application
    Set app = CreateObject("Access.Application")
    app.OpenCurrentDatabase "path-and-name-of-backend"
    ...
    app.DoCmd.TransferDatabase ...
    app.Quit
    Set app = Nothing

Posting Permissions

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