Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Linked Table Structure

Status
Not open for further replies.

OrWolf

MIS
Mar 19, 2001
291
I have a database that is upsized to SQL and want to be able to copy the structure of the linked table so I can create a local table. So far everything I've tried has resulted in another linked table. I need this to be done in code. All ideas appreciated.

Thank you.
 
I found the solution. I need to retrieve a couple of values from the linked table and then import the table directly from SQL. NOTE: I used specifically identified table 106 for testing since I knew it was linked.

Dim strConnection
Dim strTableName
Dim strSourceTableName

strConnection = CurrentDb.TableDefs(106).Connect
strTableName = CurrentDb.TableDefs(106).Name
strSourceTableName = CurrentDb.TableDefs(106).SourceTableName

DoCmd.TransferDatabase acImport, "ODBC Database", strConnection, acTable, strSourceTableName, strTableName


Thank you anyone that did any work on this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top