S
Spencer Hurst
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
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