How to Create Linked Tables At Run-Time

  • Thread starter Thread starter Todd Shillam
  • Start date Start date
T

Todd Shillam

I am looking for a method to create a linked table (from another database) during run-time within the current front-end application, such as during an EventProcedure.

I want to be able to use an SQL statement to append form data to the linked table or query data in the remote table(s). After the append and/or query takes place, I want to remove the linked table as well. I am using Microsoft Access 97 and 2000.

I know I can create linked tables using the Wizard, but given my circumstances, I think temporary linked tables would be more appropriate. Any assistance would be greatly appreciated.

Thanks in advance,


Todd Shillam
 
Todd Shillam said:
I am looking for a method to create a linked table (from another
database) during run-time within the current front-end application,
such as during an EventProcedure.

I want to be able to use an SQL statement to append form data to the
linked table or query data in the remote table(s). After the append
and/or query takes place, I want to remove the linked table as well.
I am using Microsoft Access 97 and 2000.

I know I can create linked tables using the Wizard, but given my
circumstances, I think temporary linked tables would be more
appropriate. Any assistance would be greatly appreciated.

You can use the TransferDatabase method for this. For example,

DoCmd.TransferDatabase _
acLink, "Microsoft Access", _
"C:\Temp\OtherDB.mdb", _
acTable, _
"tblOtherTableName", "tblLinkedTableName"

You'll find the details in the help file.
 
You can use the TransferDatabase method for this. For example,

DoCmd.TransferDatabase _
acLink, "Microsoft Access", _
"C:\Temp\OtherDB.mdb", _
acTable, _
"tblOtherTableName", "tblLinkedTableName"

You'll find the details in the help file.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Dirk,

Thanks! I'll give it a try.

Best regards,

Todd
 
Todd Shillam said:
I am looking for a method to create a linked table (from another database) during run-time within the current front-end application, such as during an EventProcedure.

See the TempTables.MDB page at my website which illustrates how to use
a temporary MDB in your app.
http://www.granite.ab.ca/access/temptables.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

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

Back
Top