I need to import tables from various databases on a monthly basis. Once the tables are imported, the databases are archived and not looked at again.
I have the following
Open the database with DAO, supplying the password, then you can import the tables.
Public Sub ImportEncr()
Const dbImport = "D:\DbEncr.accdb"
Const sPassword = "foobar"
Dim DB As DAO.Database
Set DB = DBEngine.OpenDatabase(Name:=dbImport, Options:=False, ReadOnly:=False, Connect:=";PWD=" & sPassword)
DoCmd.TransferDatabase acImport, "Microsoft Access", dbImport, acTable, "tblEncr", "tblEncr", False
DB.Close
Set DB = Nothing
End Sub
StoreLogin
applies to linking tables from ODBC databases.