...

View Full Version : ASP error



oliverkazaam41
11-14-2007, 08:44 PM
<%@ Language=VBScript %>
<% 'Response.buffering = true %>
<%'checkSession.inc%>
<!--#INCLUDE FILE="checkSession.inc"-->
<%
'Display Title
Function displayTitle(sField)
Dim field, myField0, myField1
field = split(sField, "*", -1, 1)
myField0 = field(0)
myField1 = field(1)
Response.Write myField0 & "- <b>" & myfield1 & "<b>"
End Function
%>
<html>
<head>
<title>Edit/Delete/Reopen/Close Job</title>

<style type="text/css">

</style></head>

<body bgcolor="#FFFFFF">
<form name="openForm" method="post" action="jobEDRCAction.asp">
<p><b><font color="#40B5BC" face="Arial, Helvetica, sans-serif" size="4">Open List:</font></b></p>
<table width="100%" border="0" cellspacing="2" cellpadding="1" name="OpenList">
<tr align="center" bgcolor="#B52936" bordercolor="#B52936">
<td width="15%"><b><font size="2" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Job
Ref.</font></b></td>
<td width="40%"><b><font size="2" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Job
Title</font></b></td>
<td width="10%"><b><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Posted
Date</font></b></td>
<td width="10%"><b><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Close</font></b></td>
<td width="10%"><b><font size="2" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Delete</font></b></td>
<td width="10%">&nbsp;</td>
</tr>
<%
'Displaying Open Jobs
Set dbConnection = Server.CreateObject("ADODB.Connection")
dbConnection.Open "Data Source=//nawinfs04/home/users/web/b2832/rh.tmhall/database/CsrJob.mdb;Provider=Microsoft.Jet.OLEDB.4.0;"
jobActiveCommand = "SELECT jobRef, jobTitle, jobPostingDate FROM jobTb WHERE jobStatus = 'Open' ORDER BY jobPostingDate DESC "
jobDeactiveCommand = "SELECT jobRef, jobTitle, jobPostingDate FROM jobTb WHERE jobStatus = 'Fill' ORDER BY jobPostingDate DESC "

Set activejobResult = dbConnection.Execute(jobActiveCommand)
Set deactivejobResult = dbConnection.Execute(jobDeactiveCommand)

%>
<%
'start create the list
dim jobcount
jobcount = 1

While Not activejobResult.EOF
%>
<tr>
<td width="15%"><font face="Arial, Helvetica, sans-serif" size="2"><%=activejobResult("jobRef")%></font></td>
<INPUT type="hidden" name="jobRef<%=jobcount%>" value="<%=activejobResult("jobRef")%>">
<td width="40%"><a href="jobDescription.asp?jobRef=<%=activejobResult("jobRef")%>" target="_blank"><font face="Arial, Helvetica, sans-serif" size="2"><%=displayTitle(activejobResult("jobTitle"))%></font></a></td>
<td width="10%" align="right"><font face="Arial, Helvetica, sans-serif" size="2"><%=activejobResult("jobPostingDate")%></font></td>
<td width="10%" align="center">
<input type="checkbox" name="closeCheckbox<%=jobcount%>" value="checkbox">
</td>
<td width="10%" align="center">
<input type="checkbox" name="deleteCheckbox<%=jobcount%>" value="checkbox">
</td>
<td width="10%" align="center">
<a href="jobEditing.asp?jobRef=<%=activejobResult("jobRef")%>"> Edit </a>
</td>
</tr>
<%
jobcount = jobcount + 1
activejobResult.MoveNext
Wend

'close all connections
activejobResult.close
Set activejobResult = Nothing

'end of the open list
%>
<tr align="center">
<td colspan="6">
<input type="submit" name="updateButton" value="Update Open List">
<input type="reset" name="clearButton" value="Clear">
<input type="hidden" name="jobCount" value="<%=jobcount%>">
</td>
</tr>
</table>
</form>
<form name="fillForm" method="post" action="jobEDRCAction.asp">
<p><font size="4" color="#40B5BC" face="Arial, Helvetica, sans-serif"><b>Filled List:</b></font></p>
<table width="100%" border="0" cellspacing="2" cellpadding="1" name="OpenList">
<tr align="center" bgcolor="#B52936" bordercolor="#B52936">
<td width="15%"><b><font size="2" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Job
Ref.</font></b></td>
<td width="40%"><b><font size="2" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Job
Title</font></b></td>
<td width="10%"><b><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Date Closed
</font></b></td>
<td width="10%"><b><font size="2" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Delete</font></b></td>
<td width="10%">&nbsp;</td>
</tr>
<%
'start create the list
dim closejobcount
closejobcount = 1

While Not deactivejobResult.EOF
%>
<tr>
<td width="15%"><font face="Arial, Helvetica, sans-serif" size="2"><%=deactivejobResult("jobRef")%></font></td>
<INPUT type="hidden" name="jobRef<%=closejobcount%>" value ="<%=deactivejobResult("jobRef")%>">
<td width="40%"><font face="Arial, Helvetica, sans-serif" size="2"><a href="jobDescription.asp?jobRef=<%=deactivejobResult("jobRef")%>" target="_blank"><%=displayTitle(deactivejobResult("jobTitle"))%></a></font></td>
<td width="10%" align="right"><font face="Arial, Helvetica, sans-serif" size="2"><%=deactivejobResult("jobPostingDate")%></font></td>
<td width="10%" align="center">
<input type="checkbox" name="deletecloseCheckbox<%=closejobcount%>" value="checkbox">
</td>
<td width="10%" align="center">
<a href="jobEditing.asp?jobRef=<%=deactivejobResult("jobRef")%>"> Edit </a>
</td>
</tr>
<%
closejobcount = closejobcount + 1
deactivejobResult.MoveNext
Wend

'close all connections
deactivejobResult.close
Set deactivejobResult = Nothing
dbConnection.Close
Set dbConnection = Nothing
'end of the close list
%>
<tr align="center">
<td colspan="6">
<input type="submit" name="updateButton" value="Update Filled List">
<input type="reset" name="clearButton" value="Clear">
<input type="hidden" name="closejobCount" value="<%=closejobcount%>">
</td>
</tr>
</table>
</form>
<table border="0" width="100%" cellspacing="0" cellpadding="10" vspace="0" hspace="0">
<tr>
<td><a href="../aspJobPosting/hrChoiceList.asp">Main Menu</a></td>
</tr>
<tr>
<td align="CENTER" valign="MIDDLE"><i><img src="../GifFiles/Buttons/breakline.GIF" width="320" height="1"><br>
<font size="2"><b><a href="mailto:webmaster@computersciencesraytheon.com">Site Problem?</a></b></font></i></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>


Hi I need your help I have this codes and it gives me an error once I view the page. The error is

Microsoft VBScript runtime error '800a0009'

Subscript out of range: '[number: 1]'

/ASPJobPosting/jobEDRC.asp, line 11

I really need your help.

Bet regards.

nikkiH
11-14-2007, 10:22 PM
I think you need to set jobcount to 0, not 1, to initialize it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum