SQL Error
am 19.09.2005 15:46:24 von Spencer HurstHi, 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" %>
<% 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 "
Login Successfull!
"Response.Write "
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
%>