Troy Overholt
asked on
Help with ASP connection to SQL
Looking for help with this code. Obviously I have something wrong.
Here is the error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/Signin/checkauth.asp, line 26
Here is my code:
Here is the error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/Signin/checkauth.asp, line 26
Here is my code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Checking Authorization</title>
</head>
<body>
<%
Dim Conn
Dim rs
Dim strSQL
Dim dbs
Dim sConnection, objConn , objRS
Session("AUTH")=0
'Set Conn = Server.CreateObject("ADODB.Connection")
'Set sConnection = Server.CreateObject("ADODB.Connection")
'Conn="DRIVER={SQL Server};SERVER=xxxxxx;UID=xxxxx;PWD=xxxxx;DATABASE=xxxxx"
sConnection.Open "DRIVER={SQL Server};SERVER=xxxxxx;UID=xxxxx;PWD=xxxxx;DATABASE=xxx"
strSQL="SELECT * FROM tblusers where email='" & Request.Form("email") & "'"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
Set objRS = objConn.Execute(strSQL)
If objRS.EOF then Response.Redirect("NonAuth.asp") Else Response.Redirect("reg/Auth.asp")
'If objRS.EOF then Session("Auth")=0
If Request.Form("pword")=objRS("pword") then Session("Auth")=1
If Session("Auth")=1 then
Session("user")= objRS("email")
Session("userid")= objRS("userid")
Response.Redirect("Auth.asp")
End If
If Session("Auth")<>1 then Response.Redirect("NonAuth.asp")
SET objRS = Nothing
SET objConn = Nothing
%>
dbp="gear-w19.websitehosting4you.com"
sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=gear-w19.websitehosting4you.com; PORT=6807; DATABASE=myce; UID=troyo;PASSWORD=1478; OPTION=3"
strSQL="SELECT * FROM tblusers where email='" & Request.Form("email") & "'"
Session("AUTH")=0
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
Set objRS = objConn.Execute(strSQL)
'If objRS.EOF then Response.Redirect("NonAuth.asp") Else Response.Redirect("reg/Auth.asp")
If objRS.EOF then Session("Auth")=0
If Request.Form("pword")=objRS("pword") then Session("Auth")=1
If Session("Auth")=1 then
Session("user")= objRS("email")
Session("userid")= objRS("userid")
Response.Redirect("Auth.asp")
End If
If Session("Auth")<>1 then Response.Redirect("NonAuth.asp")
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER