Object required error

  • Thread starter Jennifer.Berube
  • Start date
J

Jennifer.Berube

So 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 %>
<HTML>
<HEAD>
<!-- #include virtual="/inc/utility.asp" -->

<TITLE>Logon <%=SITENAME%></TITLE>
</HEAD>
<BODY>
<%=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 = "<BR>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 = "<BR>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("<P>Logon " & SITENAME & " or <A
HREF=""join.asp"">Join Now</A>.")
if sError<>"" then
Response.Write("<P><B>You were not logged in because:</B><FONT
COLOR=darkred>" & sError & "</FONT>")
end if
Response.Write(BuildForm("username","post"))
Response.Write("<TABLE>")
Response.Write("<TR><TD>User Name</TD><TD>" &
BuildInput("text","u_name",sName,20,50) & "</TD></TR>")
Response.Write("<TR><TD>Password</TD><TD>" &
BuildInput("password","u_password","",12,12) & "</TD></TR>")
Response.Write("<TR><TD COLSPAN=2>" &
BuildInput("submit","action",LOGON_ACTION,"","") & "</TD></TR>")
Response.Write("</TABLE>")
Response.Write("</FORM>")
else
Response.Write("<H2>Welcome Back " & session("u_name") & "</H2>")
Response.Write(BuildForm("","post"))
Response.Write(BuildInput("submit","action",LOGOFF_ACTION,"",""))
Response.Write("</FORM>")
end if
%>
</FORM>
</BODY>
</HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top