ASP / SQLServer connection

Discussion in 'ASP General' started by Peter Morris, Oct 9, 2004.

  1. Peter Morris

    Peter Morris Guest

    Hi, I'm having trouble connecting to SQLServer in my ASP program.

    here's the code

    <%
    dim objConnection, ObjRecorSet, strConnection, strOut, objCmd, objParameters
    Set objConnection = Server.CreateObject ("ADODB.Connection")
    strConnection = "DSN=SQL_Tracker;Database=Tracker;UID=sa;PWD=;"
    objConnection.Open strConnection
    ....
    %>

    I'm getting this error on the line that opens the connection.

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
    'HOME\IUSR_HOME'.
    /Tracker/list_team.asp, line 11


    Notes:

    I've set up the DSN called 'SQL_Tracker' in my ODBC settings.
    When I use the Test Connection button it's successful.

    The SQL Server is running on my own computer, and so I have
    full DBA rights on it

    any ideas what's wrong?
     
    Peter Morris, Oct 9, 2004
    #1
    1. Advertising

  2. Peter Morris

    Dan Guzman Guest

    Your connection string uses SQL authentication but the error message looks
    like Windows authentication was attempted. Did you specify SQL
    authentication or Windows authentication in your ODBC setup? Is your SQL
    Server configured to allow both SQL and Windows authentication?

    Also, note that you should never use 'sa' for application database
    connections and you may get uninvited guests with a blank 'sa' password.

    --
    Hope this helps.

    Dan Guzman
    SQL Server MVP

    "Peter Morris" <nospam.ple@se> wrote in message
    news:RmS9d.5432$...
    > Hi, I'm having trouble connecting to SQLServer in my ASP program.
    >
    > here's the code
    >
    > <%
    > dim objConnection, ObjRecorSet, strConnection, strOut, objCmd,
    > objParameters
    > Set objConnection = Server.CreateObject ("ADODB.Connection")
    > strConnection = "DSN=SQL_Tracker;Database=Tracker;UID=sa;PWD=;"
    > objConnection.Open strConnection
    > ...
    > %>
    >
    > I'm getting this error on the line that opens the connection.
    >
    > Error Type:
    > Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
    > [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
    > 'HOME\IUSR_HOME'.
    > /Tracker/list_team.asp, line 11
    >
    >
    > Notes:
    >
    > I've set up the DSN called 'SQL_Tracker' in my ODBC settings.
    > When I use the Test Connection button it's successful.
    >
    > The SQL Server is running on my own computer, and so I have
    > full DBA rights on it
    >
    > any ideas what's wrong?
    >
     
    Dan Guzman, Oct 9, 2004
    #2
    1. Advertising

  3. Peter Morris

    Joker Guest

    Stop using ODBC/DSN. This may not resolve the issue, but at least your
    application will be faster & the database connection will be supported
    in the future.

    Please read the following pages.

    http://www.aspfaq.com/show.asp?id=2126

    http://msdn.microsoft.com/library/d...n-us/ado270/htm/ado_deprecated_components.asp

    Peter Morris wrote:

    > Error Type:
    > Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
    > [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
    > 'HOME\IUSR_HOME'.
    > /Tracker/list_team.asp, line 11



    --
    Please do not contact me directly or ask me to contact you directly for
    assistance.

    If your question is worth asking, it's worth posting.

    If it’s not worth posting you should have done a search on
    http://www.google.com/ http://www.google.com/grphp?hl=en&tab=wg&q= or
    http://news.google.com/froogle?hl=en&tab=nf&ned=us&q= before wasting our
    time.
     
    Joker, Oct 11, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Snyder
    Replies:
    1
    Views:
    604
    Nicole Calinoiu
    Aug 23, 2004
  2. peshekeedweller

    sqlserver connection - need help desperately!

    peshekeedweller, Sep 15, 2005, in forum: ASP .Net
    Replies:
    16
    Views:
    637
    Juan T. Llibre
    Sep 18, 2005
  3. John
    Replies:
    3
    Views:
    7,814
    Darkonekt
    Oct 16, 2006
  4. =?Utf-8?B?SmVmZnJleQ==?=

    Upgrading ASP w/SQLserver 2000 to ASP.NET w/ SQLserver 2005

    =?Utf-8?B?SmVmZnJleQ==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    490
    sloan
    Apr 27, 2007
  5. Jim Corey
    Replies:
    2
    Views:
    139
    Bob Barrows [MVP]
    Dec 28, 2004
Loading...

Share This Page