Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When I execute a query in vba, the application is using a popup window titled 'SQL Server Login' and asking for a login for my datasource. It does this for several of my queries and then gives me an error when I try to do a querydef.

    I'm in a world of hurt on this application. It should have been completed last week and I'm still in developement. I would be willing to pay to have someone on call to help me with the problems that I'm encountering. I don't know if this is possible but I'm desparate.

    Thanks in advance

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Just a couple of things for you to look at.

    Are you referencing LINKED SQL SERVER tables in your query OR is it a Pass Through Query to SQL SERVER?

    If it is referencing a Linked Table, does the table request a Login as well or ONLY the query?
    If it does then the Table is Possibly NOT linked with a Saved Password.
    Try Removing the Link and then when you re-link make sure you tick Save Password Box

    If it is Pass Through Query What is in the Query ODBC Property?

    Does it Look Something Like

    ODBC;DSN=LinkDB;UID=xxxx;PWD=ppppp;DATABASE=DBName
    OR
    ODBC;DSN=LinkDB;DATABASE=DBName

    Where the DSN is Your DSN and the Database is Your database

    Does the query Run OK if NOT called from VBA?
    and so finally, HOW are you calling the Query in VBA?
    Andrew

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post
    We're assuming here that you are using attached tables to access the data via a DSN, is that correct?

    If so then -

    The first thing you should do is try to open the query from the database window.

    If you get a prompt then try to open the tables from the db window.

    If they open OK then we need to look at the code you are using to try to run the query.

    I'm on the opposite side of the world to Andrew. I'll keep an eye out for your posts so that we can help you out as fast as possible.

Posting Permissions

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