What is the syntax for entereing a query password in VBA so I don't get
the username and PW prompt? TIA
Greg
What is the syntax for entereing a query password in VBA so I don't get
the username and PW prompt? TIA
Greg
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=MyPassword
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
>
>
K Dales, thank you very much
Greg
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks