Transferdatabase to password protected db

G

Guest

Hi,
What syntax do I have to use to export a table to a password protected
db using transferdatabase or copyobject or ... with db password, ie
without invoking the password dialog?

Thanks,
Walter
 
G

Guest

forest95 said:
I have the same issue, did you ever find a solution?

Steve

Hi Steve

The trick is to import and not to export:

Set oAcc = New Access.Application
Set DB = oAcc.DBEngine.OpenDatabase(AktuellesProjekt, _
False, False, ";PWD=" & strProjPW)
oAcc.OpenCurrentDatabase strForeignDB
oAcc.DoCmd.TransferDatabase acImport, "Microsoft Access", _
CurrentProject.FullName, _
acTable, "myTable", "MyTable", True
Set DB = Nothing
Set oAcc = Nothing

Walter
 
W

Walter

nospam said:
Hi Steve

The trick is to import and not to export:

Set oAcc = New Access.Application
Set DB = oAcc.DBEngine.OpenDatabase(AktuellesProjekt, _
False, False, ";PWD=" & strProjPW)
oAcc.OpenCurrentDatabase strForeignDB
oAcc.DoCmd.TransferDatabase acImport, "Microsoft Access", _
CurrentProject.FullName, _
acTable, "myTable", "MyTable", True
Set DB = Nothing
Set oAcc = Nothing

Walter

The Line
Set DB = oAcc.DBEngine.OpenDatabase(AktuellesProjekt, _
should read
Set DB = oAcc.DBEngine.OpenDatabase(strForeignDB, _

Walter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top