TransferDatabase Method

B

box2003

In the below code sample, Phase 1 works as it should.

Phase 2 causes errors and I am not sure why the errors are being caused. I
would appreciate another set of eyes on this. I have also been able to
create Phase 2 by using recordset method (not shown) and also generate the
same errors.

Thank you.

Msg1: The "Microsoft Access" type isn't an installed database type or
doesn't support the operation you chose.

Msg2: "Invalid file type"



Private Sub Command0_Click()

Dim dbPath1 As String
Dim dbType1 As String

Dim dbPath2 As String
Dim dbType2 As String

'**** PHASE 1 ****
MsgBox "entering phase 1"

dbPath1 = "C:\Documents and Settings\Dev\devRollback.mdb"
dbType1 = "Microsoft Access"
DoCmd.TransferDatabase acExport, dbType1, dbPath1, acTable, "State",
"State_bkp"

MsgBox "exiting phase 1"

'**** PHASE 2 ****
MsgBox "entering phase 2"

'in table dbconfig, dbtype = "Microsoft Access", with quotes
'in table dbconfig, dbpath = "C:\Documents and
Settings\Dev\devRollback.mdb", with quotes
dbPath2 = DLookup("rollbackpath", "dbconfig", "configid = 1")
dbType2 = DLookup("dbtype", "dbconfig", "configid = 1")
DoCmd.TransferDatabase acExport, dbType2, dbPath2, acTable, "State",
"State_bkp"

MsgBox "exiting phase 2"

End Sub
 

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