Object required error
am 09.06.2007 02:01:33 von Jennifer.BerubeSo I setup my code finally got the connection string (include
utility.asp file) thanks to one of ya'll on here and now I have a new
problem...
This is the error I'm getting:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'GetConnection()'
/members/logon.asp, line 45
And here is the code to refer to:
<% @Language=VBScript %>
<% Option Explicit %>
<%=OutputHeader()%>
<%
' The text for the submit button
const LOGON_ACTION = "Logon..."
const LOGOFF_ACTION = "Logoff..."
Dim sError, bLogon
bLogon = Session("u_name")=""
if Request.Form("action")=LOGOFF_ACTION then
Session.Abandon()
bLogon = true
elseif Request.Form("action")=LOGON_ACTION then
' Logon
Dim sPassword, sName
sName = Trim(Request.Form("u_name"))
sPassword = Trim(Request.Form("u_password"))
if sName="" or sPassword="" then
sError = "
You did not enter a name and/ or password."
else
Dim oCmd, oConn, oRS
set oConn = GetConnection() <----- where supposedly the error
is------>
Set oCmd = GetStoredProcedure(oConn,"sp_logonuser")
oCmd.Parameters.append oCmd.CreateParameter("u_name", adVarChar,
adParamInput,50,sName)
oCmd.Parameters.append oCmd.CreateParameter("u_password",
adVarChar, adParamInput,12,spassword)
set oRS = oCmd.execute()
if oRS.eof then
sError = "
Invalid User Name or Password."
else
session("u_id") = oRS.fields("u_id")
session("u_name") = oRS.fields("u_name")
session("u_lastdate") = oRS.fields("u_lastdate")
session("u_logcount") = oRS.fields("u_logcount")
bLogon = false
end if
end if
end if
if bLogon then
Response.Write("
Logon " & SITENAME & " or
HREF=""join.asp"">Join Now.")
if sError<>"" then
Response.Write("
You were not logged in because:
COLOR=darkred>" & sError & "")
end if
Response.Write(BuildForm("username","post"))
Response.Write("
User Name | " & BuildInput("text","u_name",sName,20,50) & " |
Password | " & BuildInput("password","u_password","",12,12) & " |
" & BuildInput("submit","action",LOGON_ACTION,"","") & " |
Response.Write("")
else
Response.Write("
Welcome Back " & session("u_name") & "
")Response.Write(BuildForm("","post"))
Response.Write(BuildInput("submit","action",LOGOFF_ACTION,"" ,""))
Response.Write("")
end if
%>