Create New Link to External Database Table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Need to programmatically link a new table to an external DB. First, I would
export the table to the backend, and then I want to create a link to this
table. I know how to Refresh an existing link (using code that I found on
this site), but can't figure out how to create a new link.
 
jsccorps said:
Need to programmatically link a new table to an external DB. First, I
would
export the table to the backend, and then I want to create a link to this
table. I know how to Refresh an existing link (using code that I found on
this site), but can't figure out how to create a new link.

Is this for a new front end? why not just put the linked table in on your
machine. and then have your code copy the new table..and your table link
will already be there in place...

I simply have the new tables the font end append with a CC. So, the table
name in the new front end is different then the back end one. I then copy
the table from the front to the back..and re-name it in the process.

eg:

strFromDB = CurrentProject.FullName
strToDB = strBackEnd

DoCmd.TransferDatabase acExport, "Microsoft Access", strToDB, acTable,
"tblGroupRemindC", "tblGroupRemind", True

Since I already linked the table on my production machine, then during
deployment, I don't have to create the link, but just copy the above
table....

There is some example code here that does create a link:

http://www.granite.ab.ca/access/temptables.htm
 
thanks for replying.

This is for an existing DB that is in the field. I need to add a new table
to the Backend, and then link the Frontend to the new table.
 
jsccorps said:
thanks for replying.

This is for an existing DB that is in the field. I need to add a new
table
to the Backend, and then link the Frontend to the new table.

Ah, then you really don't need code to crate the link...do you???

Simply link to the backend on your production machine (that already has this
table).

That link is now valid.

Of course, your start up code checks for this table..and if it is not
present..then you use the transfer database code example I used....

Once you transfer that new table to the back end, then the link should be
ok....
 
Albert,

I am in what appears to be the same problems, I have one front end database
that needs to CREATE NEW LINKS from two different databases. I follow your
suggestions in looking at the website you previously mention but I did not
see any relevant code to creat e a new link using Access 2003. Any help is
appreciated
 
Back
Top