Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Sacramento, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TransferDatabase Password (Access 2007)

    I am creating a table in on database from another, and want to eliminate the popup box that asks for a password. I tried the following (without success) :

    DoCmd.TransferDatabase acExport, "Microsoft Access", "Cdssfps03UPLOAD_TC285.mdb", acTable, "X-SWCAP", "tbl_SWCAP", False, PWD = tc285

    I could only find reference in the VBA help to using the PWD Argument for an ODBC database, so this was kind of a shot in the dark.

    Is there anyway to do this using TransferDatabase, or any other way?

    Thanks!

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

    Re: TransferDatabase Password (Access 2007)

    You can't supply the password for an Access database in TransferDatabase. You must open the database in DAO before running TransferDatabase:
    <code>
    Dim dbs As DAO.Database
    Set dbs = DBEngine.OpenDatabase("Cdssfps03UPLOAD_TC285.mdb", False, False, ";pwd=tc285")
    DoCmd.TransferDatabase acExport, "Microsoft Access", "Cdssfps03UPLOAD_TC285.mdb", acTable, "X-SWCAP", "tbl_SWCAP"
    dbs.Close
    Set dbs = Nothing
    </code>
    The StoreLogin argument of TransferDatabase can only be True or False and it applies to ODBC databases, not to Access databases.

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Sacramento, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TransferDatabase Password (Access 2007)

    Thanks so much Hans...as always, your solution works perfectly....many many thanks!!

Posting Permissions

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