Using ODBC import

J

JackyWen

I want to use VBA to import/link VFP dbf to Access. And try to use below
coding:

DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=PROD;" & _
"SourceDB=E:\work\Access\;SourceType=DBF;Exclusive=No;" & _
"BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes", _
acTable, "temp.dbf", "acc_temp", False

But a run-time error (3146) is popped up.

I try to import/ link the dbf file by manual. Click "File->Get External Data-
Import (ODBC Database)->Machine Data Source (PROD)..."
It does work.

Would any one please advise what the problem is?
Thank you very much.

JW
 

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