Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Getting Object Required Error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

shaneb
Junior Member

USA
319 Posts

Posted - 11 November 2001 :  20:57:34  Show Profile  Send shaneb a Yahoo! Message
I need an ASP guru. I am getting this error

Microsoft VBScript runtime error '800a01a8'

Object required

/aspemployee/job.asp, line 128

Here is the code below, can someone tell me how to correct this?

<%Response.Expires = -1%>
<!--#INCLUDE VIRTUAL="/_private/default.asp" -->
<!--#INCLUDE VIRTUAL="/_private/media.asp" -->
<%Dim number, password, company, contname, conttitle, city, state, zip, country, phone
Dim showname, showtitle, showphone
Dim fax, email, category, title, dateposted, description, ubcat
Dim website, mode, rs, q, empcompany, empdescription, empnumber
Dim duration, hourly, yearly, perdiem

number = Request.QueryString("number")
q = "SELECT employers.website AS website, employers.company AS empcompany, " &_
"employers.description AS empdescription, employers.number AS password, jobs.invoice AS invoice, " &_
"jobs.company AS company, jobs.city AS city, jobs.state AS state, " &_
"jobs.country AS country, jobs.zip AS zip, jobs.contname AS contname, " &_
"employers.showname AS showname, employers.showtitle AS showtitle, " &_
"employers.showphone AS showphone, jobs.conttitle " &_
"AS conttitle, jobs.phone AS phone, jobs.fax AS fax, jobs.email AS email, " &_
"jobs.category AS category, jobs.title AS title, " &_
"jobs.dateposted AS dateposted, jobs.approved AS approved, jobs.description AS " &_
"description, jobs.empnumber AS empnumber, jobs.hourly AS hourly, jobs.yearly AS yearly, "&_
"jobs.perdiem AS perdiem, jobs.duration AS duration, jobs.projectstatus AS projectstatus, "&_
"jobs.startdate AS startdate, jobs.enddate AS enddate, jobs.applybyemail AS applybyemail "&_
"FROM employers INNER JOIN jobs ON employers.number = jobs.password " &_
"WHERE jobs.number = " & number
openconn
Set rs = cn.Execute(q)
password = rs("password").value
empcompany = rs("empcompany").value
empdescription = rs("empdescription").value
website = rs("website").value
company = rs("company").Value
contname = rs("contname").value
conttitle = rs("conttitle").value
showname = rs("showname").value
showtitle = rs("showtitle").value
showphone = rs("showphone").value
city = rs("city").Value
state = rs("state").Value
zip = rs("zip").Value
country = rs("country").Value
phone = rs("phone").Value
fax = rs("fax").Value
email = rs("email").Value
category = Split(rs("category").Value, ",")
ubcat = UBound(category)
title = rs("title").Value
dateposted = rs("dateposted").Value
description = rs("description").Value
empnumber = rs("empnumber").Value
hourly = rs("hourly").Value
yearly = rs("yearly").Value
perdiem = rs("perdiem").Value
duration = rs("duration").Value
projectstatus = rs("projectstatus").Value
startdate = rs("startdate").Value
enddate = rs("enddate").Value
applybyemail = rs("applybyemail").Value
%><html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Job Number <%=number%>: <%=title%></title>
<SCRIPT Language="Javascript">
var NS = (navigator.appName == "Netscape");

function printthis(){
if (NS) {
window.print() ;
}
else {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
</script>
<!--#INCLUDE VIRTUAL="/_private/style.asp" -->
</head>
<body link="<%=weblinkcolor%>" vlink="<%=webvlinkcolor%>" alink="<%=webalinkcolor%>" >

<div align="center">
<center>

<table border="2" bordercolor="<%=webtextcolor%>" cellspacing="1" cellpadding="0">
<tr>
<td width="100%" height="40" align="center">
<table border="0" cellspacing="0" cellpadding="2" width="560">
<%if getmedia(optEMPLOYER, password, extLOGO) <> "" then%>
<tr>
<td height="1" align="center" colspan="2" nowrap><%=displaymedia(optEMPLOYER, password, extLOGO, "")%><font face="<%=webfont%>" size="3" color="<%=webtextcolor%>"><b>
</b></font></td>
</tr>
<%end if%>
<tr>
<td align="center" colspan="2" nowrap height="40" valign="middle">
<hr width="80%" size="1" color="<%=webtextcolor%>">
<font face="<%=webfont%>" size="3" color="<%=webtextcolor%>">
<b> <%=title%><br>
</b></font></td>
</tr>
<tr>
<td height="114" align="center" colspan="2" nowrap>
<p><font face="<%=webfont%>" size="1"
color="<%=webtextcolor%>">
<%
ad = "<b>Job Location</b><br>" & company & "<br>"
if city <> "" then ad = ad & city
if state <> "" then ad = ad & ", " & state
if zip <> "" then ad = ad & "  " & zip
if country <> "" then ad = ad & "  " & country
if (contname <> "") AND (showname <> 0) then
ad = ad & "<br>Contact: " & contname
if (conttitle <> "") AND (showtitle <> 0) then ad = ad & " - " & conttitle
end if
if (phone <> "") OR (fax <> "") then
if ad <> "" then ad = ad & "<br>"
end if
if (phone <> "") AND (showphone <> 0) then
ad = ad & "Phone: " & phone & "    "
end if
if fax <> "" then
ad = ad & "Fax: " & fax
end if
ad = ad & "<br><a href=mailto:" & email & ">Email: " & email & "</a>"
Response.Write ad %>
</font><font face="<%=webfont%>" size="1"
color="<%=webtextcolor%>"> </font></p>
<p><font face="<%=webfont%>" size="1"
color="<%=webtextcolor%>">Brass-In Job Vacancy Number <b><%=number%></b></font><font face="<%=webfont%>" color="<%=webtextcolor%>" size="1">
<%if empnumber <> "" then%>
</font><br>
<font face="<%=webfont%>" color="<%=webtextcolor%>" size="1">Employer
Job Vacancy Number <b><%=empnumber%> </b></font></p>
<%end if%>
<font face="<%=webfont%>" size="3" color="<%=webtextcolor%>"><b>
</b></font>
<hr width="80%" size="1" color="<%=webtextcolor%>">
</td>
</tr>
<tr>
<td nowrap align="right" valign="top"><b><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"> Category: </font></b></td>
<td width="100%" valign="top"> <font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
<%for x = 0 to ubcat
Response.Write category(x) & "<br>"
next%>
 </font></td>
</tr>
<tr>
<td nowrap align="right" valign="top"> <b> <font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
Description: </font></b></td>
<td width="100%" valign="top"> <font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><%=Replace(description, vbCrLf, "<br>")%><br>
 </font></td>
</tr>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"> <b>Company <br>
 Information: </b></font></td>
<td width="100%" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"><br>
<%=empcompany%>
<%if website <> "" then%>
<br>
<a href="<%=website%>"><%=website%></a></font></td>
</tr>
<%end if%>
<tr>
<td> </td>
<td> <font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><%=Replace(empdescription, vbCrLf, "<br>")%></font><br>
<font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><font face="<%=webfont%>" size="3" color="<%=webtextcolor%>"><b>
<%while NOT rs.EOF
Select case rs("duration").value
Case "P" duration = "Permanent Position"
Case "T" duration = "Temporary Position"
Case "C" duration = "Contract Position"
Case Else duration = ""
End Select
if rs("hourly").value = 0 then
hourly = ""
else
hourly = rs("hourly").value
end if
if rs("yearly").value = 0 then
yearly = ""
else
yearly = rs("yearly").value
end if
if rs("perdiem").value = 0 then
perdiem = ""
else
perdiem = rs("perdiem").value
end if
%>
</b></font></font>  </td>
</tr>
<%if IsNumeric(hourly) OR IsNumeric(yearly) OR IsNumeric(perdiem) then%>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"> <font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
</font><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
<%if hourly <> "" then%>
</font><b>Hourly: </b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
<%Response.Write FormatCurrency(hourly)
end if
if yearly <> "" then%>
</font><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"></font></td>
</tr>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"> <b>Yearly: </b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
<%Response.Write FormatCurrency(yearly)
end if
if perdiem <> "" then%>
</font></td>
</tr>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"><b>Per Diem: </b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>">
<%Response.Write FormatCurrency(perdiem)
end if%>
</font></td>
</tr>
<%end if
if rs("projectstatus").value <> "" then%>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"><b>Project<br>
Status: </b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><%=rs("projectstatus").value%></font></td>
</tr>
<%end if
if IsDate(rs("startdate").value) then%>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"><b>Start Date:</b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><%=FormatDateTime(rs("startdate").value, vbShortDate)
%></font></td>
</tr>
<%end if
if IsDate(rs("enddate").value) then%>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"><b>End Date:</b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><%=FormatDateTime(rs("enddate").value, vbShortDate)%></font></td>
</tr>
<%end if
if duration <> "" then%>
<tr>
<td nowrap align="right" valign="top"><font face="<%=webfont%>" size="2"
color="<%=webtextcolor%>"> <b>Duration: </b></font></td>
<td><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><b><%=duration%>
</b></font></td>
</tr>
<%end if%>
</table>
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" width="560">
<tr>
<td width="34%" align="center"><font face="<%=webfont%>" size="1" color="<%=webtextcolor%>">Date
Posted: <%=FormatDateTime(dateposted, vbShortDate)%></font></td>
<td width="33%" align="center"><font face="<%=webfont%>" size="1" color="<%=webtextcolor%>">
<%if rs("applybyemail") then%><a href="/aspemployee/applyforjob.asp?job=<%=rs("number")%>">Apply For
Job</a><%else response.write " "%><%end if%>
</font><font face="<%=webfont%>" size="1" color="<%=webtextcolor%>">
</font></td>
<td width="33%" align="center"><font face="<%=webfont%>" size="1" color="<%=webtextcolor%>"><a href="javascript:printthis()">Tell
A Friend</a></font></td>
<td width="33%" align="center"><font face="<%=webfont%>" size="1" color="<%=webtextcolor%>"><a href="javascript:printthis()">Print</a></font></td>
<td width="33%" align="center"><font face="<%=webfont%>" size="1" color="<%=webtextcolor%>"><a href="javascript:window.close()">Close
Window </a></font></td>
</tr>
</table>
<p><font face="<%=webfont%>" size="2" color="<%=webtextcolor%>"><b>
<%rs.MoveNext
wend
rs.close
set rs = nothing
%>
</b></font></p>
</center>
</div>
</body>

</html>


'Surround your mind and you shall see a great future ahead'

Shane B.



Edited by - shaneb on 12 November 2001 00:59:41

Edited by - shaneb on 12 November 2001 02:43:20

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 November 2001 :  22:37:13  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
from what I could tell, the field 'hourly' was not selected into the recordset.

----
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code
Need a Mod? Check out the Mod Resource
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 11 November 2001 :  22:51:09  Show Profile
So where's line 128?


======
Doug G
======
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 November 2001 :  22:55:50  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
in my editor it was 'Case Else duration = ""'

But that wouldnt generate that error (I dont think) so I had to guestimate that it was 'if rs("hourly").value = 0 then' (2 lines down) - I checked against the select statement for the recordset, and found no sign of 'hourly'

----
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code
Need a Mod? Check out the Mod Resource
Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 12 November 2001 :  01:05:37  Show Profile  Send shaneb a Yahoo! Message
OK, I am not to bright yet on ASP. I went back in and added to the select statement and to the record set, now I get this error. Same thing different line number.

Microsoft VBScript runtime error '800a01a8'

Object required

/aspemployee/job.asp, line 139

In my editor line 139 is
<%while NOT rs.EOF 
followed by

 Select case rs("duration").value
Case "P" duration = "Permanent Position"
Case "T" duration = "Temporary Position"
Case "C" duration = "Contract Position"
Case Else duration = ""
End Select
if rs("hourly").value = 0 then
hourly = ""
else
hourly = rs("hourly").value
end if
if rs("yearly").value = 0 then
yearly = ""
else
yearly = rs("yearly").value
end if
if rs("perdiem").value = 0 then
perdiem = ""
else
perdiem = rs("perdiem").value
end if
%>


Still need your help, I'm lost.

'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  01:54:20  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
ahhh... just noticed.

Your problem is here:

rs.Close
Set rs = Nothing

Remove that and change this line:

wend
rs.Close%>

To

wend
rs.close
set rs = nothing
%>

----
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code
Need a Mod? Check out the Mod Resource

Edited by - da_stimulator on 12 November 2001 01:55:05
Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 12 November 2001 :  02:41:21  Show Profile  Send shaneb a Yahoo! Message
quote:

ahhh... just noticed.

Your problem is here:

rs.Close
Set rs = Nothing

Remove that and change this line:

wend
rs.Close%>

To

wend
rs.close
set rs = nothing
%>

----
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code
Need a Mod? Check out the Mod Resource

Edited by - da_stimulator on 12 November 2001 01:55:05




Thanks! , I also had to take out closeconn. One more error is still coming up. It says

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/aspemployee/job.asp, line 271


Line 271
 <%if rs("applybyemail") then%><a href="/aspemployee/applyforjob.asp?job=<%=rs("number")%>">Apply For  

Line 272
Job</a><%else response.write " "%><%end if%> 


It has something to with the link, but I'm not sure.

'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 12 November 2001 :  03:07:05  Show Profile  Visit Gremlin's Homepage
number doesnt seem to appear in your select, perhaps you meant just <%=number%> instead ?

Halo of Xegony
Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 12 November 2001 :  03:14:04  Show Profile  Send shaneb a Yahoo! Message
quote:

number doesnt seem to appear in your select, perhaps you meant just <%=number%> instead ?

Halo of Xegony



Yep, That was it. Thanks so much guys for all your help!



'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07