Connection Error

Discussion in 'ASP General' started by Spencer Hurst, Sep 20, 2005.

  1. Hi, I have currently found an ASP based website that i developed about 3
    years ago and am very keen to get it up and running, it's quite a simple
    site, however when i try to do anything with the database i have a
    problem with the DSN (I Think).

    The error i get is something like the following:
    [Microsoft][ODBC Driver Manager]
    Drivers SQLSetConnectAttr failed.
    /homepage/takeregistration.asp line 10.

    The code from which this error is obtained is:

    <%@ LANGUAGE="VBSCRIPT" %>
    <% pageTitle = "Login - www.schurst.co.uk" %>
    <!--#include virtual="/homepage/pagetop.txt"-->

    <% p_userid = Request.form ("p_userid")
    p_pass = Request.form ("p_pass")
    p_save = Request.form ("p_save")

    set spencerDB = Server.CreateObject ("ADODB.Connection")
    spencerDB.Open "spencer" <<<<< LINE 10

    sqlText = "select * from members where username = '" & p_userid & "'"

    set userSet = spencerDB.Execute(sqlText)
    if userSet.EOF then
    'No such username so the recordSet is empty
    Response.Redirect "/homepage/login.asp?retry=username"
    else
    'The username is good, now lets check the password
    real_password = trim (userSet("password"))
    if p_pass = real_password then
    'Password is good

    Response.Cookies ("isLoggedInAs")("username") =
    userSet("username")
    Response.cookies("isLoggedInAs") ("first_name") =
    userSet("first_name")
    Response.cookies("isLoggedInAs") ("last_name") =
    userSet("last_name")

    if p_save = "yes" then
    Response.cookies("isLoggedInAs").expires = #December 31,
    2003 00:00:00#
    end if


    spencerDB.Close
    set spencerDB = Nothing

    if Request.ServerVariables("HTTP_REFERER") =
    "/homepage/chat.asp" then
    Response.Redirect "/homepage/chat.asp"
    end if

    Response.Write "<h2 class='heading'>Login successfull!</h2>"
    Response.Write "<p>You are now successfully logged in, use the
    menus at the top or bottom to navigate through this site."


    else
    'Username is not good, but password is wrong
    Response.Redirect "/homepage/login.asp?retry=password"
    end if
    end if
    %>
    <!--#include virtual="/homepage/pagebottom.txt"-->
    </BODY>
    </HTML>

    This baffles me as i have created the DSN in the advanced tools within
    the control panel and selected an appropriate database. I am running
    Windows 2003 server edition, using a Microsoft Access database. The same
    error occurs with other pages trying to interact with the database.

    Any help on this issue will be much appreciated.

    Regards

    Spencer


    *** Sent via Developersdex http://www.developersdex.com ***
    Spencer Hurst, Sep 20, 2005
    #1
    1. Advertising

  2. Spencer Hurst wrote:
    > Hi, I have currently found an ASP based website that i developed


    Already answered over in .db

    Please do not multipost Spencer. This is definitely a database-related
    question so .asp.db was the perfect group in which to post it. Posting it
    here as well did not increase your chances of getting an answer (most of us
    subscribe to both groups). On the contrary, if somebody had taken his time
    to answer it here, only to find that it was already resolved in the other
    group, that person may have been annoyed enough to ignore any future posts
    from you, thereby decreasing your chances of getting help in the future.

    There are times when you will not be sure which group is most appropriate
    (again, this was not one of them), and you will want to post a question to
    both groups. In that situation, you should use the cross-posting technique,
    rather than posting the same message multiple times. To crosspost, put
    a semicolon-delimited* list of the newsgroups to which you wish to post in
    the To: header of your post and post it once. It, and any replies to it,
    will appear in all the newsgroups in your list. So, if I reply in .asp.db,
    my reply will also appear here in .asp.general.

    * ... or whatever delimiter is recognized by your news client

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Sep 20, 2005
    #2
    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. Mythran
    Replies:
    5
    Views:
    4,925
    Mythran
    Oct 5, 2005
  2. Dave Johnson

    Using Connection Class VS Connection Module

    Dave Johnson, Dec 9, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    618
    Dave Johnson
    Dec 11, 2005
  3. Linus Nikander
    Replies:
    5
    Views:
    529
  4. johnny
    Replies:
    1
    Views:
    777
    Jerry Hill
    Dec 8, 2006
  5. =?Utf-8?B?cGF0cmlja2RyZA==?=

    Internal connection fatal error and other random db connection err

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Jun 14, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    563
    =?Utf-8?B?cGF0cmlja2RyZA==?=
    Jun 14, 2007
Loading...

Share This Page