Can Someone Look at My Code and Hellp

liunx

Guest
So yeah with this page I'm getting this error message:
Microsoft VBScript runtime error '800a01a8'

Object required: 'conn'

/index.asp, line 20

I've looked at line 20 and can't figure out what is wrong....anyways, here is my code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'Code to prevent the page from being cached
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1

If Request.Form("Submit") = "Login" Then
Function validateStr(str)
temp = str
temp = Trim(temp)
temp = Replace(temp,"'","''")
validateStr = temp
End Function

user_name = validateStr(Request.Form("User_Name"))
user_pass = validateStr(Request.Form("Password"))

conn=Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & Server.MapPath("/nigol/PASstuff.mdb") & ";"
rsLogin = Server.CreateObject("ADODB.recordset")

rsLogin.Open "SELECT User_Name, Password FROM PASmembers WHERE User_Name = '" & User_Name & "' AND Password = '" & Password & "'", (conn)

If NOT rsLogin.EOF Then
Session("User_Name") = rsLogin("User_Name")
Response.Redirect("profile.asp")
Else
Response.Redirect("login.asp?errmsg=Login failed")
End If
rsLogin.Close
conn.Close
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>

<body>
<div id="loginbg">
<form name="form1" id="form1" action="" method="post">
<div id="username"><input name="User_Name" type="text" id="User_Name" /></div>
<div id="password"><input name="Password" type="password" id="Password" /></div>
<div id="fpass"><a class="link" href=http://www.htmlforums.com/archive/index.php/"http://www.performanceautosound.net/forgotpassword.html"> </a></div>
<div id="reg"><a class="link" href=http://www.htmlforums.com/archive/index.php/"http://www.performanceautosound.net/register.html"> </a></div>
<div id="submit"><input type="image" src=http://www.htmlforums.com/archive/index.php/"images/loginbutton.png" value="Login" name="Submit" /></div>
</form>
<%
conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("/nigol/PASstuff.mdb")
rsCurrentMembers = Server.CreateObject("ADODB.recordset")
rsCurrentMembers.Open "SELECT User_Name, Password FROM PASmembers", (conn)

If Not rsCurrentMembers.EOF Then
%>
<%
End If
rsCurrentMembers.Close
conn.Close
%>
</body>
</html>You should say:

Set conn=Server.CreateObject("ADODB.Connection")right on there DarkStreet, in ASP it is required to set the object to a reference otherwise it should error.
 
Back
Top