I have problems with the command TransferDatabase.When i open a database with a password, it is OK, but when i add on the command TransferDatabasesekd, i am asked for the password, even though the password exists in the command :
Public Function ExportTables()
Dim wsp As DAO.Workspace
Dim StrPassword As String
StrPassword = “secret”
Set wsp = DAO.DBEngine.Workspaces(0)
Dim dbs As DAO.Database
Set dbs = wsp.OpenDatabase(“C:BEstoreBE.mdb”, False, False, “;PWD=” & StrPassword)
DoCmd.TransferDatabase acExport, “Microsoft Access”, (“C:BEstoreBE.mdb”), acTable, “Customers”, “Customers”
dbs.Close
End Function
If i remove the command Transferdatabase, then i get no error and i am not asked for the password.What is wrong with my function ?