Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link DBF file using VBA 1

Status
Not open for further replies.

tsonnenl

Programmer
Apr 8, 2002
65
US
Hi-
I'm having trouble linking a dbf file in code to the current Access database. Here's the code

DoCmd.TransferDatabase acLink, "dBase IV", "//server/folder/BILLSUM.dbf", acTable, "BillSum.dbf", "BILLSUM"

What's odd is that I'm getting a "not a valid path" error, even though I use the exact same path to make a copy of the file right before the transferdatabase code is executed, so I know the path IS, in fact, valid.

All examples that I have seen link/import/export two access databases that each have DB names and table names, and I'm guessing that since the dbf file doesn't have separate file and table names, my syntax is off.

Any ideas? TIA.

Todd
 
expression.TransferDatabase(TransferType, DatabaseType, DatabaseName, ObjectType, Source, Destination, StructureOnly, StoreLogin)

DoCmd.TransferDatabase acLink, "dBase IV", "//server/folder/BILLSUM.dbf", acTable, "BillSum.dbf", "BILLSUM"

If I remember right your DatabaseName on a dbf is just the folder, so change that parameter to "//server/folder/".
The rest of it should work as you have it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top