|
 |
asp_databases thread: Checkbox Error
Message #1 by raman50@h... on Sun, 29 Apr 2001 23:31:20
|
|
Please can someone help, here's my problem..
I am returning values from a database table -Job table. The number of
values returned (or jobs) is dependent on which location is picked from a
listbox, therfore it changes. I want checkboxes to be inserted next to
the returned jobs. I've tried to do this but i keep getting a 800A040E
error, telling me i haven't closed my loop. Any help would be extremly
appreciated..
Here is the source code;
<%
Sub ShowRec(qc1, qc2, qc3, qc4, qc5)
Response.Write "<table width=0 border=1 cellpadding=3
cellspacing=3" & vbcrlf
Response.Write "<tr>"
Response.Write "<TH>Delete</TH>"
Response.Write "<TH>Name</TH>"
Response.Write "<TH>Cost</TH>"
Response.Write "</TR>"
Response.Write "<td width=200>"
Response.Write qc1
Response.Write "</td><td width=200>"
Response.Write qc2
Response.Write "</td><td width=200>"
Response.Write qc3
Response.Write "</td><td width=200>"
Response.Write qc4
Response.Write "</td><td width=200>"
Response.Write qc5
Response.Write "</td></tr></table>"
End Sub
' Putting the values of ADO constants
Const adCmdTable = &H0200
Const adLockReadOnly = 1
Const adOpenStatic = 1
Const adUseClient = 3
%>
<html>
<head>
<style>
body { font-family : Verdana; font-size : 8pt; }
</style>
</head>
<body>
<p>
<%
Dim connStr
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
& Server.MapPath("StudentForm.mdb")
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.Open"Job", connStr, adOpenStatic, adLockReadOnly,
adCmdTable
If Not rs.EOF Then
Response.Write "<tr>" & vbcrlf
Dim iLoop
Response.Write "<TR>"
Response.Write "<TH>Delete</TH>"
Response.Write "<TH>Name</TH>"
Response.Write "<TH>Cost</TH>"
Response.Write "</TR>"
'Create a checkbox to check for deleting, setting the checkboxes
'Value equal to the current items JobID
Response.Write "<TD><INPUT TYPE=CHECKBOX NAME=Select "
Response.Write "VALUE=" & CInt(RS("JobID")) & "></TD>"
'Move to the next record...
RS.MoveNext
Loop <----------error occurs here----------->
'Print the end of the table, the submit button, and the
'the end of the form.
Response.Write "</TABLE>"
Response.Write "<P><INPUT TYPE=SUBMIT VALUE=""Select Selected
Products"">"
Response.Write "</FORM>"
If request.QueryString ("JobSearch")= "Greater London" Then
'Now <b>filtering</b> the records and showing only where Location is
Greater London : Location = 'Greater London'
rs.Filter = "Location = 'Greater London'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Greater
London: Location = 'Greater London'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Ireland" Then
'Now <b>filtering</b> the records and showing only where Location is
Ireland : Location = 'Ireland'
rs.Filter = "Location = 'Ireland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Ireland:
Location = 'Ireland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Manchester" Then
'Now <b>filtering</b> the records and showing only where Location is
Manchester : Location = 'Manchester'
rs.Filter = "Location = 'Manchester'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is
Manchester: Location = 'Manchester'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Midlands" Then
'Now <b>filtering</b> the records and showing only where Location is
Midlands : Location = 'Midlands'
rs.Filter = "Location = 'Midlands'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Midlands:
Location = 'Midlands'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "North East" Then
'Now <b>filtering</b> the records and showing only where Location is North
East : Location = 'North East'
rs.Filter = "Location = 'North East'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is North
East: Location = 'North East'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "North West" Then
'Now <b>filtering</b> the records and showing only where Location is North
West : Location = 'North West'
rs.Filter = "Location = 'North West'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is NorthEast:
Location = 'NorthEast'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Northern Ireland" Then
'Now <b>filtering</b> the records and showing only where Location is
Northern Ireland : Location = 'Northern Ireland'
rs.Filter = "Location = 'Northern Ireland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Northern
Ireland: Location = 'Northern Ireland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Scotland" Then
'Now <b>filtering</b> the records and showing only where Location is
Scotland : Location = 'Scotland'
rs.Filter = "Location = 'Scotland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Scotland:
Location = 'Scotland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Wales" Then
'Now <b>filtering</b> the records and showing only where Location is
Wales : Location = 'Wales'
rs.Filter = "Location = 'Wales'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Wales:
Location = 'Wales'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "South East" Then
'Now <b>filtering</b> the records and showing only where Location is South
East: Location = 'South East'
rs.Filter = "Location = 'South East'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is South
East: Location = 'South East'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "South west" Then
'Now <b>filtering</b> the records and showing only where Location is
SouthWest: Location = 'SouthWest'
rs.Filter = "Location = 'SouthWest'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Greater
London: Location = 'SouthWest'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
Else
Response.Write "No records Found!"
End If
rs.Close
Set rs = Nothing
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
%>
<br><br>
<HR>
<TABLE BORDER=0 WIDTH=100%>
<TR ALIGN=CENTER>
<TD WIDTH=33%><A HREF="BrowseListings.asp">Browse the listings</A></TD>
<TD WIDTH=33%><A HREF="GHJ.htm">Apply for job</A></TD>
<TD WIDTH=33%><A HREF="Register.asp?Update=True">Edit Registration
Info</A></TD>
</TR>
</TABLE>
</HR>
</body>
</html>
Message #2 by Imar Spaanjaars <Imar@S...> on Mon, 30 Apr 2001 12:14:58 +0200
|
|
Well, you are "closing" the loop by using LOOP, but you are never "opening" it.
Right after you have written the table heading, you'll need a do while not
Recordset.EOF to actually loop through your recordset.
Hope this helps,
Imar
P.S. Can you please turn off HTML mail. You can see below as what kind of
mess your message arrived ;-)
At 11:31 PM 4/29/2001 +0000, you wrote:
>Please can someone help, here's my problem..
>I am returning values from a database table -Job table. The number of
>values returned (or jobs) is dependent on which location is picked from a
>listbox, therfore it changes. I want checkboxes to be inserted next to
>the returned jobs. I've tried to do this but i keep getting a 800A040E
>error, telling me i haven't closed my loop. Any help would be extremly
>appreciated..
>
>Here is the source code;
>
>
><%
>Sub ShowRec(qc1, qc2, qc3, qc4, qc5)
> Response.Write "<table width=0 border=1 cellpadding=3
>cellspacing=3" & vbcrlf
> Response.Write "<tr>"
> Response.Write "<TH>Delete</TH>"
> Response.Write "<TH>Name</TH>"
> Response.Write "<TH>Cost</TH>"
> Response.Write "</TR>"
>
> Response.Write "<td width=200>"
> Response.Write qc1
> Response.Write "</td><td width=200>"
> Response.Write qc2
> Response.Write "</td><td width=200>"
> Response.Write qc3
> Response.Write "</td><td width=200>"
> Response.Write qc4
> Response.Write "</td><td width=200>"
> Response.Write qc5
> Response.Write "</td></tr></table>"
>End Sub
>
>
>' Putting the values of ADO constants
>Const adCmdTable = &H0200
>Const adLockReadOnly = 1
>Const adOpenStatic = 1
>Const adUseClient = 3
>%>
>
>
>
>
><% Dim connStr connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
>& Server.MapPath("StudentForm.mdb") Dim rs Set rs =
>Server.CreateObject("ADODB.Recordset") rs.CursorLocation = adUseClient
>rs.Open"Job", connStr, adOpenStatic, adLockReadOnly, adCmdTable If Not
>rs.EOF Then Response.Write "
>" & vbcrlf
>Dim iLoop Response.Write "
>" Response.Write "Delete" Response.Write "Name" Response.Write "Cost"
>Response.Write "
>" 'Create a checkbox to check for deleting, setting the checkboxes 'Value
>equal to the current items JobID Response.Write " 'Print the end of the
>table, the submit button, and the 'the end of the form. Response.Write ""
>Response.Write "
>
>" Response.Write "" If request.QueryString ("JobSearch")= "Greater London"
>Then 'Now filtering the records and showing only where Location is Greater
>London : Location = 'Greater London' rs.Filter = "Location = 'Greater
>London'" Response.Write "
>
>Now filtering the records and showing only where Location is Greater
>London: Location = 'Greater London'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "Ireland" Then 'Now filtering
>the records and showing only where Location is Ireland : Location =
>'Ireland' rs.Filter = "Location = 'Ireland'" Response.Write "
>
>Now filtering the records and showing only where Location is Ireland:
>Location = 'Ireland'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "Manchester" Then 'Now
>filtering the records and showing only where Location is Manchester :
>Location = 'Manchester' rs.Filter = "Location = 'Manchester'" Response.Write "
>
>Now filtering the records and showing only where Location is Manchester:
>Location = 'Manchester'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "Midlands" Then 'Now filtering
>the records and showing only where Location is Midlands : Location =
>'Midlands' rs.Filter = "Location = 'Midlands'" Response.Write "
>
>Now filtering the records and showing only where Location is Midlands:
>Location = 'Midlands'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "North East" Then 'Now
>filtering the records and showing only where Location is North East :
>Location = 'North East' rs.Filter = "Location = 'North East'" Response.Write "
>
>Now filtering the records and showing only where Location is North East:
>Location = 'North East'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "North West" Then 'Now
>filtering the records and showing only where Location is North West :
>Location = 'North West' rs.Filter = "Location = 'North West'" Response.Write "
>
>Now filtering the records and showing only where Location is NorthEast:
>Location = 'NorthEast'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "Northern Ireland" Then 'Now
>filtering the records and showing only where Location is Northern Ireland
>: Location = 'Northern Ireland' rs.Filter = "Location = 'Northern
>Ireland'" Response.Write "
>
>Now filtering the records and showing only where Location is Northern
>Ireland: Location = 'Northern Ireland'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "Scotland" Then 'Now filtering
>the records and showing only where Location is Scotland : Location =
>'Scotland' rs.Filter = "Location = 'Scotland'" Response.Write "
>
>Now filtering the records and showing only where Location is Scotland:
>Location = 'Scotland'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "Wales" Then 'Now filtering the
>records and showing only where Location is Wales : Location = 'Wales'
>rs.Filter = "Location = 'Wales'" Response.Write "
>
>Now filtering the records and showing only where Location is Wales:
>Location = 'Wales'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "South East" Then 'Now
>filtering the records and showing only where Location is South East:
>Location = 'South East' rs.Filter = "Location = 'South East'" Response.Write "
>
>Now filtering the records and showing only where Location is South East:
>Location = 'South East'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend ' Moving the record
>pointer to the beginning rs.MoveFirst ' Removing the filter rs.Filter = ""
>Else If request.QueryString ("JobSearch")= "South west" Then 'Now
>filtering the records and showing only where Location is SouthWest:
>Location = 'SouthWest' rs.Filter = "Location = 'SouthWest'" Response.Write "
>
>Now filtering the records and showing only where Location is Greater
>London: Location = 'SouthWest'
>
>" & vbcrlf
>While Not rs.EOF ShowRec rs("JobID"), rs ("Employer Name"), rs("Title"),
>rs("Salary"), rs("Closing Date") rs.MoveNext Wend Else Response.Write "No
>records Found!" End If rs.Close Set rs = Nothing End If End If End If End
>If End If End If End If End If End If End If End If %>
>
>
>----------
><BrowseListings.htm>Browse the listings <GHJ.htm>Apply for job
><Register.htm>Edit Registration Info
Message #3 by raman50@h... on Mon, 30 Apr 2001 16:25:33
|
|
Hi Imar, thanks for the advice. I tried to open the loop except now i get
a 8000a0400 error stating "expected statement " on End sub. If you could
help me resolve this i'd be extremly grateful! Thanks
> Well, you are "closing" the loop by using LOOP, but you are
never "opening" it.
>
> Right after you have written the table heading, you'll need a do while
not
> Recordset.EOF to actually loop through your recordset.
>
> Hope this helps,
>
> Imar
>
> P.S. Can you please turn off HTML mail. You can see below as what kind
of
> mess your message arrived ;-)
>
> At 11:31 PM 4/29/2001 +0000, you wrote:
> >Please can someone help, here's my problem..
> >I am returning values from a database table -Job table. The number of
> >values returned (or jobs) is dependent on which location is picked from
a
> >listbox, therfore it changes. I want checkboxes to be inserted next to
> >the returned jobs. I've tried to do this but i keep getting a 800A040E
> >error, telling me i haven't closed my loop. Any help would be extremly
> >appreciated..
> >
> >Here is the source code;
> >
> >
> ><%
> >Sub ShowRec(qc1, qc2, qc3, qc4, qc5)
> > Response.Write "<table width=0 border=1 cellpadding=3
> >cellspacing=3" & vbcrlf
> > Response.Write "<tr>"
> > Do while not rs.EOF
Response.Write "<TH>Delete</TH>"
> > Response.Write "<TH>Name</TH>"
> > Response.Write "<TH>Cost</TH>"
> > Response.Write "</TR>"
> >
> > Response.Write "<td width=200>"
> > Response.Write qc1
> > Response.Write "</td><td width=200>"
> > Response.Write qc2
> > Response.Write "</td><td width=200>"
> > Response.Write qc3
> > Response.Write "</td><td width=200>"
> > Response.Write qc4
> > Response.Write "</td><td width=200>"
> > Response.Write qc5
> > Response.Write "</td></tr></table>"
> >End Sub <-----------------800A0400--------------------------->
> >
> >
> >' Putting the values of ADO constants
> >Const adCmdTable = &H0200
> >Const adLockReadOnly = 1
> >Const adOpenStatic = 1
> >Const adUseClient = 3
> >%>
html>
<head>
<style>
body { font-family : Verdana; font-size : 8pt; }
</style>
</head>
<body>
<p>
<%
Dim connStr
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
& Server.MapPath("StudentForm.mdb")
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.Open"Job", connStr, adOpenStatic, adLockReadOnly,
adCmdTable
If Not rs.EOF Then
Response.Write "<tr>" & vbcrlf
Dim iLoop
Response.Write "<TR>"
Response.Write "<TH>Delete</TH>"
Response.Write "<TH>Name</TH>"
Response.Write "<TH>Cost</TH>"
Response.Write "</TR>"
'Create a checkbox to check for deleting, setting the checkboxes
'Value equal to the current items JobID
Response.Write "<TD><INPUT TYPE=CHECKBOX NAME=Select "
Response.Write "VALUE=" & CInt(RS("JobID")) & "></TD>"
'Move to the next record...
RS.MoveNext
Loop <----------error occurs here----------->
'Print the end of the table, the submit button, and the
'the end of the form.
Response.Write "</TABLE>"
Response.Write "<P><INPUT TYPE=SUBMIT VALUE=""Select Selected
Products"">"
Response.Write "</FORM>"
If request.QueryString ("JobSearch")= "Greater London" Then
'Now <b>filtering</b> the records and showing only where Location is
Greater London : Location = 'Greater London'
rs.Filter = "Location = 'Greater London'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Greater
London: Location = 'Greater London'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Ireland" Then
'Now <b>filtering</b> the records and showing only where Location is
Ireland : Location = 'Ireland'
rs.Filter = "Location = 'Ireland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Ireland:
Location = 'Ireland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Manchester" Then
'Now <b>filtering</b> the records and showing only where Location is
Manchester : Location = 'Manchester'
rs.Filter = "Location = 'Manchester'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is
Manchester: Location = 'Manchester'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Midlands" Then
'Now <b>filtering</b> the records and showing only where Location is
Midlands : Location = 'Midlands'
rs.Filter = "Location = 'Midlands'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Midlands:
Location = 'Midlands'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "North East" Then
'Now <b>filtering</b> the records and showing only where Location is North
East : Location = 'North East'
rs.Filter = "Location = 'North East'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is North
East: Location = 'North East'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "North West" Then
'Now <b>filtering</b> the records and showing only where Location is North
West : Location = 'North West'
rs.Filter = "Location = 'North West'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is NorthEast:
Location = 'NorthEast'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Northern Ireland" Then
'Now <b>filtering</b> the records and showing only where Location is
Northern Ireland : Location = 'Northern Ireland'
rs.Filter = "Location = 'Northern Ireland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Northern
Ireland: Location = 'Northern Ireland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Scotland" Then
'Now <b>filtering</b> the records and showing only where Location is
Scotland : Location = 'Scotland'
rs.Filter = "Location = 'Scotland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Scotland:
Location = 'Scotland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Wales" Then
'Now <b>filtering</b> the records and showing only where Location is
Wales : Location = 'Wales'
rs.Filter = "Location = 'Wales'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Wales:
Location = 'Wales'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "South East" Then
'Now <b>filtering</b> the records and showing only where Location is South
East: Location = 'South East'
rs.Filter = "Location = 'South East'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is South
East: Location = 'South East'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "South west" Then
'Now <b>filtering</b> the records and showing only where Location is
SouthWest: Location = 'SouthWest'
rs.Filter = "Location = 'SouthWest'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Greater
London: Location = 'SouthWest'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
Else
Response.Write "No records Found!"
End If
rs.Close
Set rs = Nothing
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
%>
<br><br>
<HR>
<TABLE BORDER=0 WIDTH=100%>
<TR ALIGN=CENTER>
<TD WIDTH=33%><A HREF="BrowseListings.asp">Browse the listings</A></TD>
<TD WIDTH=33%><A HREF="GHJ.htm">Apply for job</A></TD>
<TD WIDTH=33%><A HREF="Register.asp?Update=True">Edit Registration
Info</A></TD>
</TR>
</TABLE>
</HR>
</body>
</html>
Message #4 by Imar Spaanjaars <Imar@S...> on Mon, 30 Apr 2001 17:41:26 +0200
|
|
Can you repost the current code of just the sub? I couldn't find my way in
the code anymore ;-)
Imar
At 04:25 PM 4/30/2001 +0000, you wrote:
>Hi Imar, thanks for the advice. I tried to open the loop except now i get
>a 8000a0400 error stating "expected statement " on End sub. If you could
>help me resolve this i'd be extremly grateful! Thanks
>
Message #5 by "Jason Byrnes" <byrnes@f...> on Mon, 30 Apr 2001 16:05:50 -0400
|
|
It looks to me like you removed the the closing "Loop" from the line before
"End Sub" try putting that back in, and you should be all set.
Hope this helps
Jason
<raman50@h...> wrote in message news:61203@a..._databases...
>
> Hi Imar, thanks for the advice. I tried to open the loop except now i get
> a 8000a0400 error stating "expected statement " on End sub. If you could
> help me resolve this i'd be extremly grateful! Thanks
>
>
> > Well, you are "closing" the loop by using LOOP, but you are
> never "opening" it.
> >
> > Right after you have written the table heading, you'll need a do while
> not
> > Recordset.EOF to actually loop through your recordset.
> >
> > Hope this helps,
> >
> > Imar
> >
> > P.S. Can you please turn off HTML mail. You can see below as what kind
> of
> > mess your message arrived ;-)
> >
> > At 11:31 PM 4/29/2001 +0000, you wrote:
> > >Please can someone help, here's my problem..
> > >I am returning values from a database table -Job table. The number of
> > >values returned (or jobs) is dependent on which location is picked from
> a
> > >listbox, therfore it changes. I want checkboxes to be inserted next to
> > >the returned jobs. I've tried to do this but i keep getting a 800A040E
> > >error, telling me i haven't closed my loop. Any help would be extremly
> > >appreciated..
> > >
> > >Here is the source code;
> > >
> > >
> > ><%
> > >Sub ShowRec(qc1, qc2, qc3, qc4, qc5)
> > > Response.Write "<table width=0 border=1 cellpadding=3
> > >cellspacing=3" & vbcrlf
> > > Response.Write "<tr>"
> > > Do while not rs.EOF
> Response.Write "<TH>Delete</TH>"
> > > Response.Write "<TH>Name</TH>"
> > > Response.Write "<TH>Cost</TH>"
> > > Response.Write "</TR>"
> > >
> > > Response.Write "<td width=200>"
> > > Response.Write qc1
> > > Response.Write "</td><td width=200>"
> > > Response.Write qc2
> > > Response.Write "</td><td width=200>"
> > > Response.Write qc3
> > > Response.Write "</td><td width=200>"
> > > Response.Write qc4
> > > Response.Write "</td><td width=200>"
> > > Response.Write qc5
> > > Response.Write "</td></tr></table>"
> > >End Sub <-----------------800A0400--------------------------->
> > >
> > >
> > >' Putting the values of ADO constants
> > >Const adCmdTable = &H0200
> > >Const adLockReadOnly = 1
> > >Const adOpenStatic = 1
> > >Const adUseClient = 3
> > >%>
> html>
> <head>
> <style>
> body { font-family : Verdana; font-size : 8pt; }
> </style>
> </head>
>
> <body>
>
>
>
>
> <p>
> <%
> Dim connStr
> connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
> & Server.MapPath("StudentForm.mdb")
>
> Dim rs
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.CursorLocation = adUseClient
> rs.Open"Job", connStr, adOpenStatic, adLockReadOnly,
> adCmdTable
>
> If Not rs.EOF Then
> Response.Write "<tr>" & vbcrlf
>
>
> Dim iLoop
> Response.Write "<TR>"
> Response.Write "<TH>Delete</TH>"
> Response.Write "<TH>Name</TH>"
> Response.Write "<TH>Cost</TH>"
> Response.Write "</TR>"
>
>
> 'Create a checkbox to check for deleting, setting the checkboxes
> 'Value equal to the current items JobID
> Response.Write "<TD><INPUT TYPE=CHECKBOX NAME=Select "
> Response.Write "VALUE=" & CInt(RS("JobID")) & "></TD>"
>
> 'Move to the next record...
> RS.MoveNext
>
> Loop <----------error occurs here----------->
>
>
> 'Print the end of the table, the submit button, and the
> 'the end of the form.
> Response.Write "</TABLE>"
> Response.Write "<P><INPUT TYPE=SUBMIT VALUE=""Select Selected
> Products"">"
> Response.Write "</FORM>"
>
>
> If request.QueryString ("JobSearch")= "Greater London" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Greater London : Location = 'Greater London'
> rs.Filter = "Location = 'Greater London'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Greater
> London: Location = 'Greater London'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
> Else
>
>
>
>
> If request.QueryString ("JobSearch")= "Ireland" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Ireland : Location = 'Ireland'
> rs.Filter = "Location = 'Ireland'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Ireland:
> Location = 'Ireland'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
> Else
> If request.QueryString ("JobSearch")= "Manchester" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Manchester : Location = 'Manchester'
> rs.Filter = "Location = 'Manchester'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is
> Manchester: Location = 'Manchester'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "Midlands" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Midlands : Location = 'Midlands'
> rs.Filter = "Location = 'Midlands'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Midlands:
> Location = 'Midlands'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "North East" Then
> 'Now <b>filtering</b> the records and showing only where Location is North
> East : Location = 'North East'
> rs.Filter = "Location = 'North East'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is North
> East: Location = 'North East'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "North West" Then
> 'Now <b>filtering</b> the records and showing only where Location is North
> West : Location = 'North West'
> rs.Filter = "Location = 'North West'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is NorthEast:
> Location = 'NorthEast'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "Northern Ireland" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Northern Ireland : Location = 'Northern Ireland'
> rs.Filter = "Location = 'Northern Ireland'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Northern
> Ireland: Location = 'Northern Ireland'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "Scotland" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Scotland : Location = 'Scotland'
> rs.Filter = "Location = 'Scotland'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Scotland:
> Location = 'Scotland'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "Wales" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> Wales : Location = 'Wales'
> rs.Filter = "Location = 'Wales'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Wales:
> Location = 'Wales'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "South East" Then
> 'Now <b>filtering</b> the records and showing only where Location is South
> East: Location = 'South East'
> rs.Filter = "Location = 'South East'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is South
> East: Location = 'South East'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
> ' Moving the record pointer to the
> beginning
> rs.MoveFirst
> ' Removing the filter
> rs.Filter = ""
>
> Else
> If request.QueryString ("JobSearch")= "South west" Then
> 'Now <b>filtering</b> the records and showing only where Location is
> SouthWest: Location = 'SouthWest'
> rs.Filter = "Location = 'SouthWest'"
> Response.Write "<br><br>Now
> <b>filtering</b> the records and showing only where Location is Greater
> London: Location = 'SouthWest'<br><br>" & vbcrlf
> While Not rs.EOF
> ShowRec rs("JobID"), rs
> ("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> rs.MoveNext
> Wend
>
> Else
> Response.Write "No records Found!"
> End If
>
> rs.Close
> Set rs = Nothing
> End If
> End If
> End If
> End If
> End If
> End If
> End If
> End If
> End If
> End If
> End If
> %>
>
> <br><br>
>
>
> <HR>
> <TABLE BORDER=0 WIDTH=100%>
> <TR ALIGN=CENTER>
> <TD WIDTH=33%><A HREF="BrowseListings.asp">Browse the
listings</A></TD>
> <TD WIDTH=33%><A HREF="GHJ.htm">Apply for job</A></TD>
> <TD WIDTH=33%><A HREF="Register.asp?Update=True">Edit Registration
> Info</A></TD>
> </TR>
> </TABLE>
>
> </HR>
> </body>
> </html>
>
>
>
Message #6 by raman50@h... on Mon, 30 Apr 2001 21:55:43
|
|
> >Here's the code again Imar, sorry to be a pain! I'm not too sure how >
>to turn off HTML Mail,so if arrives in a mess again, my apologies-not >
>intentional! If it makes life easier you can mail me ur E-mail address >
>and i can mail you directly..Cheers
Raman
------------------------------------------------------------------------
Can you repost the current code of just the sub? I couldn't find my way in
> the code anymore ;-)
> Imar
>
-----------------------------------------------------------------------
> At 04:25 PM 4/30/2001 +0000, you wrote:
> >Hi Imar, thanks for the advice. I tried to open the loop except now i
get
> >a 8000a0400 error stating "expected statement " on End sub. If you
could
> >help me resolve this i'd be extremly grateful! Thanks
----------------------------------------------------------------------
><%
> >Sub ShowRec(qc1, qc2, qc3, qc4, qc5)
> > Response.Write "<table width=0 border=1 cellpadding=3
> >cellspacing=3" & vbcrlf
> > Response.Write "<tr>"
> > Do while not rs.EOF
Response.Write "<TH>Delete</TH>"
> > Response.Write "<TH>Name</TH>"
> > Response.Write "<TH>Cost</TH>"
> > Response.Write "</TR>"
> >
> > Response.Write "<td width=200>"
> > Response.Write qc1
> > Response.Write "</td><td width=200>"
> > Response.Write qc2
> > Response.Write "</td><td width=200>"
> > Response.Write qc3
> > Response.Write "</td><td width=200>"
> > Response.Write qc4
> > Response.Write "</td><td width=200>"
> > Response.Write qc5
> > Response.Write "</td></tr></table>"
> >End Sub <-----------------800A0400--------------------------->
> >
> >
> >' Putting the values of ADO constants
> >Const adCmdTable = &H0200
> >Const adLockReadOnly = 1
> >Const adOpenStatic = 1
> >Const adUseClient = 3
> >%>
> >html>
> ><head>
> > <style>
> > body { font-family : Verdana; font-size : 8pt; }
> > </style>
> ></head>
> >
> ><body>
> >
> >
> >
> >
> ><p>
> ><%
> > Dim connStr
> > connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
> >& Server.MapPath("StudentForm.mdb")
> >
> > Dim rs
> > Set rs = Server.CreateObject("ADODB.Recordset")
> > rs.CursorLocation = adUseClient
> > rs.Open"Job", connStr, adOpenStatic, adLockReadOnly,
> >adCmdTable
> >
> > If Not rs.EOF Then
> > Response.Write "<tr>" & vbcrlf
> >
> >
> >Dim iLoop
> >Response.Write "<TR>"
> > Response.Write "<TH>Delete</TH>"
> > Response.Write "<TH>Name</TH>"
> > Response.Write "<TH>Cost</TH>"
> > Response.Write "</TR>"
> >
> >
> >'Create a checkbox to check for deleting, setting the checkboxes
> > 'Value equal to the current items JobID
> > Response.Write "<TD><INPUT TYPE=CHECKBOX NAME=Select "
> > Response.Write "VALUE=" & CInt(RS("JobID")) & "></TD>"
> >
> >'Move to the next record...
> > RS.MoveNext
> >
> > Loop <----------error occurs here----------->
> >
> >
> >'Print the end of the table, the submit button, and the
> > 'the end of the form.
> > Response.Write "</TABLE>"
> > Response.Write "<P><INPUT TYPE=SUBMIT VALUE=""Select Selected
> >Products"">"
> > Response.Write "</FORM>"
> >
> >
> >If request.QueryString ("JobSearch")= "Greater London" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Greater London : Location = 'Greater London'
> > rs.Filter = "Location = 'Greater London'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is Greater
> >London: Location = 'Greater London'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the
> >beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >Else
> >
> >
> >
> >
> >If request.QueryString ("JobSearch")= "Ireland" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Ireland : Location = 'Ireland'
> > rs.Filter = "Location = 'Ireland'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>Ireland:
> >Location = 'Ireland'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the
> >beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >Else
> >If request.QueryString ("JobSearch")= "Manchester" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Manchester : Location = 'Manchester'
> > rs.Filter = "Location = 'Manchester'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is
> >Manchester: Location = 'Manchester'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the
> >beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "Midlands" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Midlands : Location = 'Midlands'
> > rs.Filter = "Location = 'Midlands'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>Midlands:
> >Location = 'Midlands'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the
> >beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "North East" Then
> >'Now <b>filtering</b> the records and showing only where Location is >
>North
> >East : Location = 'North East'
> > rs.Filter = "Location = 'North East'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is North
> >East: Location = 'North East'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the
> >beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "North West" Then
> >'Now <b>filtering</b> the records and showing only where Location is >
>North
> >West : Location = 'North West'
> > rs.Filter = "Location = 'North West'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>NorthEast:
> >Location = 'NorthEast'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the
> >beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Northern Ireland" Then
'Now <b>filtering</b> the records and showing only where Location is
Northern Ireland : Location = 'Northern Ireland'
rs.Filter = "Location = 'Northern Ireland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Northern
Ireland: Location = 'Northern Ireland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Scotland" Then
'Now <b>filtering</b> the records and showing only where Location is
Scotland : Location = 'Scotland'
rs.Filter = "Location = 'Scotland'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Scotland:
Location = 'Scotland'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "Wales" Then
'Now <b>filtering</b> the records and showing only where Location is
Wales : Location = 'Wales'
rs.Filter = "Location = 'Wales'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Wales:
Location = 'Wales'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "South East" Then
'Now <b>filtering</b> the records and showing only where Location is South
East: Location = 'South East'
rs.Filter = "Location = 'South East'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is South
East: Location = 'South East'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
' Moving the record pointer to the
beginning
rs.MoveFirst
' Removing the filter
rs.Filter = ""
Else
If request.QueryString ("JobSearch")= "South west" Then
'Now <b>filtering</b> the records and showing only where Location is
SouthWest: Location = 'SouthWest'
rs.Filter = "Location = 'SouthWest'"
Response.Write "<br><br>Now
<b>filtering</b> the records and showing only where Location is Greater
London: Location = 'SouthWest'<br><br>" & vbcrlf
While Not rs.EOF
ShowRec rs("JobID"), rs
("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
rs.MoveNext
Wend
Else
Response.Write "No records Found!"
End If
rs.Close
Set rs = Nothing
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
%>
<br><br>
<HR>
<TABLE BORDER=0 WIDTH=100%>
<TR ALIGN=CENTER>
<TD WIDTH=33%><A HREF="BrowseListings.asp">Browse the listings</A></TD>
<TD WIDTH=33%><A HREF="GHJ.htm">Apply for job</A></TD>
<TD WIDTH=33%><A HREF="Register.asp?Update=True">Edit Registration
Info</A></TD>
</TR>
</TABLE>
</HR>
</body>
</html>
><%
> >Sub ShowRec(qc1, qc2, qc3, qc4, qc5)
> > Response.Write "<table width=0 border=1 cellpadding=3
> >cellspacing=3" & vbcrlf
> > Response.Write "<tr>"
> > Do while not rs.EOF
Response.Write "<TH>Delete</TH>"
> > Response.Write "<TH>Name</TH>"
> > Response.Write "<TH>Cost</TH>"
> > Response.Write "</TR>"
> >
> > Response.Write "<td width=200>"
> > Response.Write qc1
> > Response.Write "</td><td width=200>"
> > Response.Write qc2
> > Response.Write "</td><td width=200>"
> > Response.Write qc3
> > Response.Write "</td><td width=200>"
> > Response.Write qc4
> > Response.Write "</td><td width=200>"
> > Response.Write qc5
> > Response.Write "</td></tr></table>"
> >End Sub <-----------------800A0400 Error-------------------------->
> >
> >
> >' Putting the values of ADO constants
> >Const adCmdTable = &H0200
> >Const adLockReadOnly = 1
> >Const adOpenStatic = 1
> >Const adUseClient = 3
> >%>
> >html>
> ><head>
> > <style>
> > body { font-family : Verdana; font-size : 8pt; }
> > </style>
> ></head>
> >
> ><body>
> >
> >
> >
> >
> ><p>
> ><%
> > Dim connStr
> > connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
> >& Server.MapPath("StudentForm.mdb")
> >
> > Dim rs
> > Set rs = Server.CreateObject("ADODB.Recordset")
> > rs.CursorLocation = adUseClient
> > rs.Open"Job", connStr, adOpenStatic, adLockReadOnly,
> >adCmdTable
> >
> > If Not rs.EOF Then
> > Response.Write "<tr>" & vbcrlf
> >
> >
> >Dim iLoop
> >Response.Write "<TR>"
> > Response.Write "<TH>Delete</TH>"
> > Response.Write "<TH>Name</TH>"
> > Response.Write "<TH>Cost</TH>"
> > Response.Write "</TR>"
> >
> >
> >'Create a checkbox to check for deleting, setting the checkboxes
> > 'Value equal to the current items JobID
> > Response.Write "<TD><INPUT TYPE=CHECKBOX NAME=Select "
> > Response.Write "VALUE=" & CInt(RS("JobID")) & "></TD>"
> >
> >'Move to the next record...
> > RS.MoveNext
> >
> > Loop <----------error occured here----------->
> >
> >
> >'Print the end of the table, the submit button, and the
> > 'the end of the form.
> > Response.Write "</TABLE>"
> > Response.Write "<P><INPUT TYPE=SUBMIT VALUE=""Select Selected
> >Products"">"
> > Response.Write "</FORM>"
> >
> >
> >If request.QueryString ("JobSearch")= "Greater London" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Greater London : Location = 'Greater London'
> > rs.Filter = "Location = 'Greater London'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is Greater
> >London: Location = 'Greater London'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >Else
> >
> >
> >If request.QueryString ("JobSearch")= "Ireland" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Ireland : Location = 'Ireland'
> > rs.Filter = "Location = 'Ireland'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>Ireland:
> >Location = 'Ireland'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >Else
> >If request.QueryString ("JobSearch")= "Manchester" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Manchester : Location = 'Manchester'
> > rs.Filter = "Location = 'Manchester'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is
> >Manchester: Location = 'Manchester'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "Midlands" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Midlands : Location = 'Midlands'
> > rs.Filter = "Location = 'Midlands'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>Midlands:
> >Location = 'Midlands'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "North East" Then
> >'Now <b>filtering</b> the records and showing only where Location is >
>North East : Location = 'North East'
> > rs.Filter = "Location = 'North East'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is North
> >East: Location = 'North East'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "North West" Then
> >'Now <b>filtering</b> the records and showing only where Location is >
>North West : Location = 'North West'
> > rs.Filter = "Location = 'North West'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>NorthEast:
> >Location = 'NorthEast'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "Northern Ireland" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Northern Ireland : Location = 'Northern Ireland'
> > rs.Filter = "Location = 'Northern Ireland'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>Northern Ireland: Location = 'Northern Ireland'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "Scotland" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Scotland : Location = 'Scotland'
> > rs.Filter = "Location = 'Scotland'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is >
>Scotland:
> >Location = 'Scotland'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
Else
If request.QueryString ("JobSearch")= "Wales" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >Wales : Location = 'Wales'
> > rs.Filter = "Location = 'Wales'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is Wales:
> >Location = 'Wales'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "South East" Then
> >'Now <b>filtering</b> the records and showing only where Location is >
>South East: Location = 'South East'
> > rs.Filter = "Location = 'South East'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is South
> >East: Location = 'South East'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> > ' Moving the record pointer to the beginning
> > rs.MoveFirst
> > ' Removing the filter
> > rs.Filter = ""
> >
> >Else
> >If request.QueryString ("JobSearch")= "South west" Then
> >'Now <b>filtering</b> the records and showing only where Location is
> >SouthWest: Location = 'SouthWest'
> > rs.Filter = "Location = 'SouthWest'"
> > Response.Write "<br><br>Now
> ><b>filtering</b> the records and showing only where Location is Greater
> >London: Location = 'SouthWest'<br><br>" & vbcrlf
> > While Not rs.EOF
> > ShowRec rs("JobID"), rs
> >("Employer Name"), rs("Title"), rs("Salary"), rs("Closing Date")
> > rs.MoveNext
> > Wend
> >
> > Else
> > Response.Write "No records Found!"
> > End If
> >
> > rs.Close
> > Set rs = Nothing
> > End If
> > End If
> >End If
> >End If
> >End If
> >End If
> >End If
> >End If
> >End If
> >End If
> >End If
> >%>
> >
> ><br><br>
> >
> >
> ><HR>
> ><TABLE BORDER=0 WIDTH=100%>
> > <TR ALIGN=CENTER>
> > <TD WIDTH=33%><A HREF="BrowseListings.asp">Browse the >
>listings</A></TD>
> > <TD WIDTH=33%><A HREF="GHJ.htm">Apply for job</A></TD>
> > <TD WIDTH=33%><A HREF="Register.asp?Update=True">Edit Registration
> >Info</A></TD>
> > </TR>
> ></TABLE>
> >
> ></HR>
> ></body>
> ></html>
|
|
 |