Re: Link table in code doesn't "take"

message from Terry Kreft on 6 May 2004
Personally I would do it like this

strConnect = "ODBC;Description=" & strDesc & ";DRIVER=SQL Server;SERVER=" &
gstrSQLServer & ";UID=sa;PWD=" & strPWD & ";APP=Microsoft Open Database
Connectivity;WSID=" & strWS & ";DATABASE=Prototype"

For Each tdf In db.TableDefs
with tdf
if len(.Connect)> 0 then
.Connect = strConnect
.RefreshLink
End If
end with
Next

I seem to remember (in the dim distant past) that testing the Attribute as
you are doing can fail which is why I test whether the table has a
connection string.
 

Archived message: Re: Link table in code doesn't "take" (MS Access Forms)