Login failed for user

Discussion in 'Databases' started by Nov, Jun 25, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Nov

    Nov

    Hi

    I have IIS Web server and SQL database 2000 server on my PC(standalone).
    When I run my ASP page, sometimes I got the error....

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'MYPC\IUSR_MYNAME'.

    1. I used mix authentication for SQL database.

    2. Connection string inside the APS page is ... as below
    MyConn.Open "FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\ok.dsn"

    3. For ok.dsn, I used default login, which is "windows NT authentication using network login id"

    4. I gave access permission for the login account('MYPC\IUSR_MYNAME') for the datatabse.But it still did not work out.

    But I think it cannot be configuration problem because I don't get this error all the time. For the same ASP program, and same configuration, sometimes it turned out okay but sometimes I got this error.

    And it should not be network problem also as I am testing in my standalone PC.right??

    Please help me with this...I am really lost here.
    thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    i suggest you use DSNLess connection which will simplify the issue. You also gain much performance and stability using OleDB DSNLess connection.

    See this kb article, all you need to do is to update the Db & server name.


    quote:Originally posted by Nov

    Hi

    I have IIS Web server and SQL database 2000 server on my PC(standalone).
    When I run my ASP page, sometimes I got the error....

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'MYPC\IUSR_MYNAME'.

    1. I used mix authentication for SQL database.

    2. Connection string inside the APS page is ... as below
    MyConn.Open "FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\ok.dsn"

    3. For ok.dsn, I used default login, which is "windows NT authentication using network login id"

    4. I gave access permission for the login account('MYPC\IUSR_MYNAME') for the datatabse.But it still did not work out.

    But I think it cannot be configuration problem because I don't get this error all the time. For the same ASP program, and same configuration, sometimes it turned out okay but sometimes I got this error.

    And it should not be network problem also as I am testing in my standalone PC.right??

    Please help me with this...I am really lost here.
    thanks.


    </blockquote id="quote"></font id="quote">
     
  3. Nov

    Nov

    I changed to oledb as below.

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "Provider=sqloledb;" & _
    "Data Source=MYPC\NEWSERVER;" & _
    "Initial Catalog=Northwind;" & _
    "User Id=myname;" & _
    "Password=12345678"

    but i got this error.

    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E4D)
    Login failed for user 'eieichaw1'.
     
  4. Nov

    Nov

    sorry....

    the error is.

    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E4D)
    Login failed for user 'myname'.
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    is the user set up as SQL user or is it a Windows user?


    quote:Originally posted by Nov

    sorry....

    the error is.

    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E4D)
    Login failed for user 'myname'.



    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page