I was having trouble using transferdatabase to export some tables to a non-user-level-password protected database – I would provide the password when prompted, but the tables wouldn’t export. I found an answer in Francois’s May 15 post to Aral where he suggested using the copyobject method, and provided the following code sample with which I can now get the tables to export. However, I am still prompted for the password. Anyone know why?
Thanks,
Randy
Sub CopyTable()
Dim db As DAO.Database
Dim ws As DAO.Workspace
Dim rst As DAO.Recordset
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(“C:protecteddb.mdb”, False, False, “MS Access;PWD=secret”)
DoCmd.CopyObject db.Name, “table1”, acTable, “table1”
db.Close
End Sub