Relinking ODBC Tables

B

Brenda

I have an access 97 database and in that database is a
table that is located on a sql server.

I want to create a button that allows the user to relink
the table automatically.

What is the vba code that I need to do this ????

Thanks in advance
 
B

Bas Cost Budde

Brenda said:
I have an access 97 database and in that database is a
table that is located on a sql server.

I want to create a button that allows the user to relink
the table automatically.

What is the vba code that I need to do this ????

Thanks in advance

Cut from my project:

DoCmd.TransferDatabase acLink, "ODBC-database",
"ODBC;DSN=EMG;UID=;PWD=;APP=Microsoft®
Access;WSID=;LANGUAGE=us_english;DATABASE=" & cSrc & ";TABLE=dbo." &
rs!tabel, acTable, rs!tabel, "dbo_" & rs!tabel

EMG is the name of the DSN. Supply yours.

rs!tabel is a field in an open recordset that contains a table name (the
word tabel is Dutch for table)

HTH
 

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

Top