Link to home
Start Free TrialLog in
Avatar of brokeMyLegBiking
brokeMyLegBiking

asked on

Execute a DoCmd.TransferDatabase in MS Access using VB.NET

From an an Access Macro you can execute a DoCmd.TransferDatabase command, which will copy a table including indexes and everything from one database to another.

How can I call a DoCmd using VB.NET?

Here is the syntax, as found in the Access help:
DoCmd.TransferDatabase acImport, "Microsoft Access", _
    "C:\My Documents\NWSales.mdb", acReport, "NW Sales for April", _
    "Corporate Sales for April"

I tried using an OledbCommand.ExecuteNonQuery, but that did not work.

thx,

-brokeMyLegBiking

ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brokeMyLegBiking
brokeMyLegBiking

ASKER

Ok, that sounds good. I'll try that, thank you very much for your help.
It worked, that's great. Thanks.