Results 1 to 7 of 7

Thread: Unable To Connect To MS SQL Server 2000

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Question Unable To Connect To MS SQL Server 2000

    Hi,

    I can't seem to connect to my database.

    Can someone please kindly help me out? Thanks alot...

    Dim sqlConn As SqlConnection = New SqlConnection
    Dim connStr As String = "Server=Lex;Database=xxxDB;Trusted_Connection=True;"

    I'm not very sure about the server name part, how can I check it out? Or is there any problems with the connection string? Because I get the following error:

    Login failed for user 'LEX\ASPNET'.
    ______________________________________

    Warmest Regards,

    Lex
    ______________________________________



    :|: Don't Mess With The Predator :|:

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Unable To Connect To MS SQL Server 2000

    ASP.Net is attempting to connect to your database using the ASP.Net user (usually IUSR_MachineName) - you'll need to add that user to SQL (and your database) to fix this error. Alternatively, you can use a specific user instead of integrated authentication.


  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Unable To Connect To MS SQL Server 2000

    We do two-tier systems for local area networks - so I've got no experience with ASP...

    But axion_sa - how is logging in with a default user a secure method? On the other hand how is specifying the username and password in the connection secure?

    Just wondering - since I don't work in this realm.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Unable To Connect To MS SQL Server 2000

    Quote Originally Posted by szlamany
    We do two-tier systems for local area networks - so I've got no experience with ASP...

    But axion_sa - how is logging in with a default user a secure method? On the other hand how is specifying the username and password in the connection secure?

    Just wondering - since I don't work in this realm.
    The IUSR_MachineName user is created by ASP.Net on installation and is a local user that has highly limited rights on the local machine. There isn't much one may do with that user (e.g. access folders or files outside the ASP.Net domain) should one hack the account. That being said, it isn't at all easy to brute-force the ASP.Net account password - standing under correction here, but I believe the password is about 150 characters in length, randomly chosen by ASP.Net itself. So, all in all, using the ASP.Net account is not a problem at all. One may change that (for example in the <processModel> sections in web.config or machine.config) or change by changing the account running IIS (or the application pool on Windows 2003)).

    With regards to using a specific SQL user - the security is relative. If you use limited access credentials (i.e. not "sa") with access to only that database, limited execution/read rights on SQL, security breaches won't that large. However, if one does use sa or other highly privileged user, the implications...


  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Unable To Connect To MS SQL Server 2000

    Thanks for the info - never know when I might be asked an ASP question or expected to do something in that area!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Re: Unable To Connect To MS SQL Server 2000

    Hi,

    I still don't really understand what you people are trying to convey. Can someone simplify this for me? Also, I've added a specific user to the database using Enterprise Manager.

    I don't really know what's wrong... -.-"
    ______________________________________

    Warmest Regards,

    Lex
    ______________________________________



    :|: Don't Mess With The Predator :|:

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Unable To Connect To MS SQL Server 2000

    Quote Originally Posted by Lex@SG
    Also, I've added a specific user to the database using Enterprise Manager.
    By this I assume you mean you've created a new user and are talking about SQL Server authentication. For such a case, change your connection string to:

    "Server=SERVERNAME;Database=pubs;User ID=newuser;Password=asdasd;Trusted_Connection=False"

Posting Permissions

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



Click Here to Expand Forum to Full Width