ms access RunSavedImportExport with username/password

Posted on 2012-08-13
Medium Priority
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
  • 2
LVL 120

Expert Comment

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

Author Comment

ID: 38288393
Many thanks - what coding would I use?
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 38288573
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

850 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