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