failed to connect to SQL server from asp.net

Discussion in 'ASP .Net' started by ajfish@blueyonder.co.uk, Jun 7, 2006.

  1. Guest

    Hello,

    I have an asp.net application which connects to SQL server using the
    normal ado.net mechanism. One customer cannot get it to connect to the
    database. his connection string is

    user id=aaaa;password=bbbb;initial catalog=cccc;server=dddd

    and he gets the message:

    Cannot open database requested in login 'cccc'. Login fails. Login
    failed for user 'aaaa'.

    The customer insists that he has the values in the connection string
    correct; the only unusual thing is that dddd is actually the IP address
    rather than the host name of the SQL server box.

    I am not in a position to do any direct investigation myself. many
    other customers are using the same software without problems. does
    anyone have any clues what might cause this error, other than invalid
    username/password combination?

    TIA

    Andy
    , Jun 7, 2006
    #1
    1. Advertising

  2. If the Sql Server is not enabled for "Mixed mode" (both SQL and Windows)
    authentication, they could possibly get that error.
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "" wrote:

    > Hello,
    >
    > I have an asp.net application which connects to SQL server using the
    > normal ado.net mechanism. One customer cannot get it to connect to the
    > database. his connection string is
    >
    > user id=aaaa;password=bbbb;initial catalog=cccc;server=dddd
    >
    > and he gets the message:
    >
    > Cannot open database requested in login 'cccc'. Login fails. Login
    > failed for user 'aaaa'.
    >
    > The customer insists that he has the values in the connection string
    > correct; the only unusual thing is that dddd is actually the IP address
    > rather than the host name of the SQL server box.
    >
    > I am not in a position to do any direct investigation myself. many
    > other customers are using the same software without problems. does
    > anyone have any clues what might cause this error, other than invalid
    > username/password combination?
    >
    > TIA
    >
    > Andy
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jun 7, 2006
    #2
    1. Advertising

  3. Andy Fish Guest

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > wrote:
    >> Hello,
    >>
    >> I have an asp.net application which connects to SQL server using the
    >> normal ado.net mechanism. One customer cannot get it to connect to the
    >> database. his connection string is
    >>
    >> user id=aaaa;password=bbbb;initial catalog=cccc;server=dddd
    >>
    >> and he gets the message:
    >>
    >> Cannot open database requested in login 'cccc'. Login fails. Login
    >> failed for user 'aaaa'.
    >>
    >> The customer insists that he has the values in the connection string
    >> correct; the only unusual thing is that dddd is actually the IP
    >> address rather than the host name of the SQL server box.
    >>
    >> I am not in a position to do any direct investigation myself. many
    >> other customers are using the same software without problems. does
    >> anyone have any clues what might cause this error, other than invalid
    >> username/password combination?
    >>

    > That's the only cause I know of.


    when I looked at the error message a little closer and reproduced it, I
    realised the problem was actually down to the database name being incorrect,
    not the username and password

    d'oh !

    > if the IP address was the problem, he would be getting a "not found"
    > message rather than "login failed", which implies a connection to the
    > database was initiated, but terminated due to improper credentials.
    >
    > The customer should check the sql error logs as well as the event logs
    > to see if any other errors or warnings are present.
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Andy Fish, Jun 12, 2006
    #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. =?Utf-8?B?UmV6YQ==?=
    Replies:
    3
    Views:
    17,890
    Carlos Barini
    Jun 7, 2004
  2. Replies:
    3
    Views:
    40,166
    Roedy Green
    Nov 16, 2005
  3. Bob Barrows [MVP]

    Re: failed to connect to SQL server from asp.net

    Bob Barrows [MVP], Jun 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    370
    Bob Barrows [MVP]
    Jun 7, 2006
  4. Wesley Chen
    Replies:
    0
    Views:
    208
    Wesley Chen
    Apr 7, 2009
  5. Wesley Chen
    Replies:
    9
    Views:
    235
    Sean O'Halpin
    Apr 14, 2009
Loading...

Share This Page