Transfer text into a database other than current database

gthull644

New member
Local time
Today, 11:00
Joined
Jun 23, 2005
Messages
5
If I call a procedure in another database the code in that database will run, I'll call it the "Remote" database. An instruction such as "docmd.OpenQuery" in the remote procedure will run a query in the remote database. OK, but what doesn't work is a TransferText instruction such as:

DoCmd.TransferText _ acImportDelim, "Data", "tblData", "D:\Data\VAS\VASFull.csv", True

Annoyingly the data will be transferred to the database that was the original calling database that made the call to the remote database. eg

DB A calls procedure in DB X, above code in DB X imports data to tblData in DB A and not DB X which is where I want it!

Other instructions run in the remote database against objects in the remote database. Why not TransferText?

Solution Please!
 
What exactly are you trying to do? I'm not sure that .TransferText is the best option.
 
You must open the database as an application and qualify the table names in that database because they are not in the "default" workspace. Look up workspaces in the Help files. Once the external db is open, you could open a recordset to it or do other operations. But first, you have to actually create an Access application object in order to get to its tables to do an insert.

Why not "Transfer Text" ? 'cause it's a WIZARD. Translation - resides in a .DLL file ON YOUR MACHINE. DLL files are a bit funky. If you don't tell them exactly where everything goes, they make some (incorrect in your case) assumptions. That is because they aren't mapped (made part of your program's memory) until they are actually needed. That's why they are called DYNAMIC link libraries.

I think if you can figure out how to properly qualify the workspace in which your table resides, you could get TransferText to work.
 

Users who are viewing this thread

Back
Top Bottom