
VB using DAO to execute Access query containing a linked table
I did find a simple way to solve my dilema. After I open my database, I
find the linked table in the TableDefs collection. After adding/replacing
the uid and pwd, I call the RefreshLink method. Now I no longer get the
Sybase login and I can control the userid and password from my VB code.
Set mdbCrosstab = OpenDatabase(strPath, , True)
Set tblLinked = mdbCrosstab.TableDefs(strLinkedTable)
tblLinked.Connect =
"ODBC;DSN=dsn;SRVR=srvr;DATABASE=db;UID=userid;PWD=password"
tblLinked.RefreshLink
Mark Tucker
Quote:
> I am using VB 5 and DAO to execute a crosstab query in VB. One of the
> tables used for this query is a linked table to Sybase. Whenever I
execute
> the query, I get the Sybase ODBC login box. How can I pass the userid
and
> password from VB so that I don't get the Sybase login? The access
database
> currently does not have any security.
> Mark Tucker
> Please also e-mail me back a response.