Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    300

    Question Unanswered: Auto login to SQL Server from Access VBA?

    Everytime I run a particular piece of code, it will ask me for the MS SQL connection information. Although I already have a SQL ODBC connection, it wants me to select the connection, then enter in the SQL password.

    I want to know how to automate this or put it into my MS Access VBA code?

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Depends on the code you are using, dunnit?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Nov 2003
    Posts
    300
    it sure does, but all i have so far is this:

    'cnn.Open "SQL_SERVER", "username", "password"

    i am running a query def for a stored proc , so is this going before the DoCmd for opening the passthrough query?

    whatelse do I need to do?

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Again, it depends on the code! That's just a teeny snippet and , I suspect, is a lot more than "all i have so far".

    My best guess at piecing this together is that you are executing a pass through query. If so then the cnn (I assume that is an ADODB connection object) is totally redundant. The connection string is part of the query definition.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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