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:

<%@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>

Open in new window

Troy OverholtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I don't know what line 26 in your error corresponds to above, but you have commented out some code.

You have in line 23 above "sConnection.Open ...." but you commented out  line 19 "'Set sConnection = ..."
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Troy OverholtAuthor Commented:
Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.