Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the syntax for entereing a query password in VBA so I don't get
the username and PW prompt? TIA Greg |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The User ID (UID) and password (PWD) are part of the connection string, so it
depends on the database you are using. Either your db documentation or an online search should help with it, but you can also set up a simple query in MSQuery (where you supply the user id and password and tell it to save them - for now) and then look at the QueryTable.Connection property to see the connection string format; here is a simple example: ODBC;DSN=MyDataSource;UID=MyUserName;PWD=MyPasswor d To code this in VB, set the string manually to include the userID and password before running the query. But, be aware that any knowledgeable person with access to your code can steal your db user id and password if you do this, so if security is an issue this may not be advisable. -- - K Dales "GregR" wrote: What is the syntax for entereing a query password in VBA so I don't get the username and PW prompt? TIA Greg |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
K Dales, thank you very much
Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password protect only a single module? | Excel Programming | |||
Query a Access database that has a module from Excel | Excel Discussion (Misc queries) | |||
Password protect only one VBA code module? | Excel Programming | |||
Module password locked | Excel Programming | |||
Class Module query | Excel Programming |