VB using DAO to execute Access query containing a linked table 
Author Message
 VB using DAO to execute Access query containing a linked table

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.



Tue, 08 Aug 2000 03:00:00 GMT  
 VB using DAO to execute Access query containing a linked table

Hi Mark,

When you link the table within Access there should be a checkbox that allows
the saving of the connection password with the linked table.

By default this is always unchecked, but just check it and hopefully problem
solved.

Best Regards

Trevor Dwyer

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.



Tue, 08 Aug 2000 03:00:00 GMT  
 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.



Fri, 11 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. executing Access query containing a user-defined function through VB

2. Executing Access query containing a user-defined function through VB

3. Strange ODBC errors using DAO to access linked tables

4. Accessing Linked Oracle Tables in Access Using ODBC in VB

5. Newbiw having problems with Permanent QueryDef: Query input must contain at least one table or query

6. Using VB to link tables in Access

7. linking an excel spreadsheet to an access table using vb

8. Linking Excel As Tables Using DAO

9. Linked tables using ADO instead of DAO?

10. Linking Tables from SQL 7 to Acces using DAO

11. Using Access queries containing functions from VB5

12. LINKING TABLES using DAO and SQL

 

 
Powered by phpBB® Forum Software