ms access RunSavedImportExport with username/password

Posted on 2012-08-13
Last Modified: 2012-09-12

I have some code that runs a docmd.RunSavedImportExport import with the imported tables coming from another Access db.  However this db requries a username/password - is it possible to add this to the RunSavedImportExport code?

Many thanks

Question by:kenabbott
    LVL 119

    Expert Comment

    by:Rey Obrero
    hmm, i don't think that the RunSavedImportExport method have that capability.
    you need to use vba coding to achieve this.

    Author Comment

    Many thanks - what coding would I use?
    LVL 119

    Accepted Solution

    something like this

    Dim extDB As String, db As DAO.Database, strPwd As String
    strPwd = "abcdef"

    extDB = "<path to your db>"

    Set db = DBEngine.Workspaces(0).OpenDatabase(extDB, False, False, ";pwd=" & strPwd)

    docmd.transferdatabase acimport, microsoft access", extDB,actable, "SourceTableName","DestinationTableName", false

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now