+ Reply to Thread
Results 1 to 3 of 3

Enter Query Password in Module

  1. #1
    GregR
    Guest

    Enter Query Password in Module

    What is the syntax for entereing a query password in VBA so I don't get
    the username and PW prompt? TIA

    Greg


  2. #2
    K Dales
    Guest

    RE: Enter Query Password in Module

    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
    >
    >


  3. #3
    GregR
    Guest

    Re: Enter Query Password in Module

    K Dales, thank you very much

    Greg


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1