Creating linked tables in code...

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I have a database app where I want to be able to create a new linked table
on request for a particular function, and then delete that link when the
process is completed.

I think I have seen where this can be accomplished in code. Does anyone have
any sample code that does this type of thing?

Thanks,

Brad
 
Brad said:
I have a database app where I want to be able to create a new linked table
on request for a particular function, and then delete that link when the
process is completed.

I think I have seen where this can be accomplished in code. Does anyone have
any sample code that does this type of thing?


You can use the TransferDatabase method to do that (see Help
for details).

Another way is to use DAO code to create a TableDef object
and then set its Connect property. To figure out what the
Connect string should be, it's easiest to manually link to
the table using the File - Import menu and the inspect the
Connect property that Access created:
MsgBox CurrentDb.TableDefs!tablename.Connect
 
Back
Top