Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2003
    Location
    Maryland
    Posts
    21

    Unanswered: Login failed for user '(null)'

    I am using VB.Net, and MSSQL 7.0 (not 100% sure about the sql server)

    Ok, so I fixed this once before by add "<identity impersonate="true"/>" to my web.config file.

    Now, I am able do everything from my computer (which happens to be the web server were VB.Net is). But I get the "Login failed for user '(null)'" error from any other computer?!?

    How would it be possible that everything works from one computer, and not another. I wouldn't be so confused if it was just other users who don't have access, but it's also me.

    Here is the connection string I am using (don't know how much help it will be):

    Dim cmdSelect As New SqlClient.SqlCommand(strSQL, New SqlClient.SqlConnection("server=dev-cite;database=LOGSPR;Trusted_Connection=True"))
    cmdSelect.CommandType = CommandType.StoredProcedure
    cmdSelect.Parameters.Add("@order_by", qsSort)
    cmdSelect.Parameters.Add("@selected", selectvalue)

    There is supposed to be a single group set up that has access to the stored procedures, which run on the tables, but even before I gave the group access to the stored procedures, I was able to run everything just fine (from the 1 computer). I'm guessing that's because I'm the owner of the db. Any help would be greatly appreciated. Thanks!

  2. #2
    Join Date
    Oct 2003
    Posts
    268
    Your using "Trusted Connection=True". This is Windows authentication as opposed to SQL Server authentication.

    Windows authentication typically only works across a network if you are using Active Directory. I would guess you don't have that setup so as far as Windows security is concerned you are a null user.

    You probably want to switch to SQL Server authentication: explict SQL Server only user name/passwords.

  3. #3
    Join Date
    Oct 2003
    Location
    Maryland
    Posts
    21
    Is that the same as "Mixed Mode". If so, that's not what I want. I want to stay will Trusted Connection. And I don't want to use a specific name/pass, that's why I added the impersonation to the web.config file. That line should impersonation the current users information for the SQL server. Maybe I'm a little confused here (I'm really not that good with SQL), but I know that I don't what to use a specific name/pass, because there is a group that has access, not just one person.

    Please let me know if I'm way off here. Thanks!

  4. #4
    Join Date
    May 2003
    Posts
    60
    Have you created a login for the Windows Group they are all in or have you created inidividual logins for each windows account?

    You will have to do one or the other before the group will have access. Also, you will have to grant them permissions in the database in question by associating the login account to a database role.

  5. #5
    Join Date
    Oct 2003
    Location
    Maryland
    Posts
    21
    Good question. The DBA was handling all that, and I assume he knows what he is doing (just like he assumes I know what i'm doing :-D), but I will check on it.

    But still, would that explain why I can access the SQL server from my computer, but not from other computers???

  6. #6
    Join Date
    Oct 2003
    Posts
    268
    Originally posted by kw.wainwright

    But still, would that explain why I can access the SQL server from my computer, but not from other computers???
    The login you are using on your computer is recognized and trusted by the database server system (is this your system?).

    The login used by the other computers isn't recognized/trusted on the database server.

    We have Active Directory set up so that a domain login is recognized everywhere. I don't know how your network is set up.

    If you solve the problem, I'd like to hear what you did.

  7. #7
    Join Date
    Oct 2003
    Location
    Maryland
    Posts
    21
    I wish I knew more, but I guess I just don't ask enough question. I'm still somewhat new, and I am only in charge of a small website that we run.

    I'm guessing we must have AD, because we have 2 main domains that everybody uses (a few thousand people). And I can go to any computer and use my username/pass/domain to log on.

    The computer where everything is working is my computer. This computer is also the development web server computer. It has IIS and VS.Net, and this is wear I am doing all of my work. So, all files are being saved to this computer, and when I use IE to access the pages, I am really just going through the domain controller, and then back to my computer. SQL is not on this computer. We have a separate SQL server.

    The other computer that I am using to test is in my office, has IIS, but is not the web server. That is the only difference that I can see, and therefore I would think that it has something to do with .Net, and not SQL, but the error I am getting is definitely an SQL error. This computer is connected to the network, and I log onto it the same way I log onto my main computer.

    My DBA is asking me some more questions, so maybe he's got an idea of what's going on. If I do solve the problem, I will be sure to post the results.

  8. #8
    Join Date
    Oct 2003
    Location
    Maryland
    Posts
    21
    Still no luck. My DBA thought that it might be my IIS settings (checking to make sure that I was using "basic authentication"). But That wasn't the problem.

    It obviously has something to do with how the SQL server is being accessed (at least that's what I'm assuming). If my computer running IIS can get to it, but no other computer can, do you think it's an SQL problem or an IIS problem? It's starting to sound more and more like an IIS problem.

  9. #9
    Join Date
    Oct 2003
    Location
    Maryland
    Posts
    21
    Ok, ignor my last post. It was an IIS Authentication problem. I thought to use basic authentication, I just needed to uncheck the "Anonymous access", and make sure the "Basic authentication" box was checked. Turns out, I also had to uncheck the "Integrated Windows authentication" option. Thanks for the help, and hopefully this post will help others.

Posting Permissions

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