Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2006
    Posts
    6

    Unanswered: Database Connection Error

    Dear Sirs,
    I am working on my first sql server web application. I have read many documents and I have gone to many forums, but i have'nt found any answer. Can you help me please.
    Here is my problem:
    I can't connect to my database. I use windows authentication and i log in as administrator. I have installed personal edition of sql server and IIS is installed in my computer. I use this scripts:

    <%
    dim objCon
    set objCon = server.CreateObject("ADODB.Connection")
    objCon.ConnectionString="DSN=dbna.dsn;uid=sa;pwd=; database=na2"
    objCon.open
    %>

    Where dbna.dsn have been defined in "Data Sources (ODBC)" part of control panel.
    When I open the webpage i receive this error:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'ALADDIN\IUSR_ALADDIN'.
    /dbconnect.asp, line 5

    My computer name is ALADDIN and my username is Omid.
    Best regards,
    Omid.

  2. #2
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    so you are first setting this up on your home computer and will replicate all of the info onto your web server ?

    ' This is a DSN-LESS Connection. it requires the Driver Info and server.
    TheDatabase.Open "Driver={SQL Server}; Server=servername ; UID=USER_ID ; Password=passowrd; Database=databaseName"

    ' This is a DSN Connection. it does not require Driver or server. only provider and the DSN
    TheDatabase.Open "PROVIDER=MSDASQL;DSN=DSN_Name; UID=USER_ID ; Password=passowrd; Database=databaseName"

    i think that MSDASQL is the most recent provider name, that should not change.

    then use somethnig like this to retrieve your data into a recordset.
    SQL="SELECT Visitor, visitDate, visitTime FROM Visitors
    Set rsData = TheDatabase.Execute(SQL)
    .
    .
    http://www.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

  3. #3
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Well,
    the best way to deal with this problem is ......
    Firstly make your server mixed authentication ..to do it right click the server name and click properties>security>click option buttonwindows and sql server authentication> then
    Open Sql server enterprise manager>
    Click your database>
    Under your database click user>
    Rightclick user to create new database user>
    give a name "XYZ" and password "XYZ" then choose your database,then role checked the db_owner role for this user if you want to give it a full previledges.(public will be checked by default)
    then click ok.
    Then open query analyser> put yuor username and password to check it.If its working ok then
    use it using DSN LESS Connection or DSN connection.
    I hope everything will work ok this time.
    Joydeep

  4. #4
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    he said he is using personal edition of sql server
    i dont think that has Sql server enterprise manager, isnt it just the dos type interface ?

    he needs to make it work on his machine without doing anything special as it needs to work on the web server as well. if he make special changes on his machines and the web server is not swet up like that, then its still not going to work when he uploads it.
    .
    .
    http://www.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

  5. #5
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Oh yes Kropes2001, I missed out that info.
    Well,I just made my comment regarding the error he got.Its a common error and it happens due to login problem.I just suggested that thing which helped me a lot in my cases.
    By the way,its not good to use personal edition of sql server for a real time project.Isn't it?
    Joydeep

  6. #6
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    using personal edition on your own machine for testing purposes is cool, but not for a live app on the internet. i think person edition has a connection limitation of like 5 or 10 simultaneous connections... but i cant remember off hand.
    .
    .
    http://www.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

  7. #7
    Join Date
    Jan 2006
    Posts
    6

    Thanks alot

    Thanks alot. I changed my authentication mode to mixed. Now i can connect to my database but I can't understand why i can't use windows authentication.

Posting Permissions

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