Hi, this is a tricky one, ;O
I can successfully provide a search for say 'region' but when trying to combine this with a search for say 'industry' at the same time. e.g 'region' louisiana 'jobs' health care. I'd be really gratefull cause I've been surfing all day for an answer. Thanks
It gives me the error
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "SELECT JobTable.Comp"]'
/industrysearchregion.asp, line 19
the code is as follows
form-
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Dim oRSv
Set oRSv=Server.CreateObject("adodb.Recordset"
oRSv.Open "IndustryTable", "dsn=50on"
oRSv.MoveFirst
%>
<form method="post" action="industrysearchregion.asp">
<h5>Select region</h5>
<input type="submit" value="search">
<select name="industry" size="1">
<%
Do While NOT oRSv.EOF
Response.Write "<option value='" & oRSv("industry" & "'>"
Response.Write oRSv("industry" & "</option>"
oRSv.MoveNext
loop
oRSv.Close
Set oRSv=nothing
%>
</select>
<%
Dim oRSr
Set oRSr=Server.CreateObject("adodb.Recordset"
oRSr.Open "RegionTable", "dsn=50on"
oRSr.MoveFirst
%>
<h5>Select region</h5>
<input type="hidden">
<select name="region" size="1">
<%
Do While NOT oRSr.EOF
Response.Write "<option value='" & oRSr("region" & "'>"
Response.Write oRSr("region" & "</option>"
oRSr.MoveNext
loop
oRSr.Close
Set oRSr=nothing
%>
</select>
</body>
</html>
response page-
<html>
<head>
<title>search a job</title>
</head>
<body>
<%
varindustry=Request.Form("industry"
varregion=Request.Form("region"
Dim oRS2
dim iRowCounter
Set oRS2=Server.CreateObject("adodb.Recordset"
sSQL="SELECT JobTable.Company, JobTable.industry, JobTable.Jobtitle, JobTable.region"
sSQL=sSQL & " FROM JobTable"
sSQl=sSQL & " WHERE region='" & varregion & "'"
sSQL=sSQL & "'" AND "WHERE industry='" & varindustry & "'"
sSQL=sSQL & " ORDER BY JobTable.Jobtitle;"
oRS2.open sSQL, "DSN=50on"
if oRS2.EOF=True then
Response.write ("Sorry, no jobs were found in this sector"
else oRS2.MoveFirst
response.write "<table bgcolor=Silver valign=top width=500 bordercolordark=Gray border=0>"
response.write "<th bgcolor=white> Job title </th>" & "<th bgcolor=white> Industry </th>" & "<th bgcolor=white>Company</th>" & "<th bgcolor=white> Region </th>"
Do while Not oRS2.EOF
''<a href='" & oRS2 ("ID" & "'>
Response.Write "<tr><td>" & oRS2 ("Jobtitle" & "</td>"
Response.Write "<td>" & oRS2 ("industry" & "</td>"
response.write "<td>" & oRS2 ("Company" & "</td>"
response.write "<td>" & oRS2 ("region" & "</td></tr>"
oRS2.MoveNext
Loop
end if
oRS2.Close
set oRS2=Nothing
response.write "</table>"
%>
</font>
</body>
</html>
cheeeeers!
Gavin
I can successfully provide a search for say 'region' but when trying to combine this with a search for say 'industry' at the same time. e.g 'region' louisiana 'jobs' health care. I'd be really gratefull cause I've been surfing all day for an answer. Thanks
It gives me the error
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "SELECT JobTable.Comp"]'
/industrysearchregion.asp, line 19
the code is as follows
form-
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Dim oRSv
Set oRSv=Server.CreateObject("adodb.Recordset"
oRSv.Open "IndustryTable", "dsn=50on"
oRSv.MoveFirst
%>
<form method="post" action="industrysearchregion.asp">
<h5>Select region</h5>
<input type="submit" value="search">
<select name="industry" size="1">
<%
Do While NOT oRSv.EOF
Response.Write "<option value='" & oRSv("industry" & "'>"
Response.Write oRSv("industry" & "</option>"
oRSv.MoveNext
loop
oRSv.Close
Set oRSv=nothing
%>
</select>
<%
Dim oRSr
Set oRSr=Server.CreateObject("adodb.Recordset"
oRSr.Open "RegionTable", "dsn=50on"
oRSr.MoveFirst
%>
<h5>Select region</h5>
<input type="hidden">
<select name="region" size="1">
<%
Do While NOT oRSr.EOF
Response.Write "<option value='" & oRSr("region" & "'>"
Response.Write oRSr("region" & "</option>"
oRSr.MoveNext
loop
oRSr.Close
Set oRSr=nothing
%>
</select>
</body>
</html>
response page-
<html>
<head>
<title>search a job</title>
</head>
<body>
<%
varindustry=Request.Form("industry"
varregion=Request.Form("region"
Dim oRS2
dim iRowCounter
Set oRS2=Server.CreateObject("adodb.Recordset"
sSQL="SELECT JobTable.Company, JobTable.industry, JobTable.Jobtitle, JobTable.region"
sSQL=sSQL & " FROM JobTable"
sSQl=sSQL & " WHERE region='" & varregion & "'"
sSQL=sSQL & "'" AND "WHERE industry='" & varindustry & "'"
sSQL=sSQL & " ORDER BY JobTable.Jobtitle;"
oRS2.open sSQL, "DSN=50on"
if oRS2.EOF=True then
Response.write ("Sorry, no jobs were found in this sector"
else oRS2.MoveFirst
response.write "<table bgcolor=Silver valign=top width=500 bordercolordark=Gray border=0>"
response.write "<th bgcolor=white> Job title </th>" & "<th bgcolor=white> Industry </th>" & "<th bgcolor=white>Company</th>" & "<th bgcolor=white> Region </th>"
Do while Not oRS2.EOF
''<a href='" & oRS2 ("ID" & "'>
Response.Write "<tr><td>" & oRS2 ("Jobtitle" & "</td>"
Response.Write "<td>" & oRS2 ("industry" & "</td>"
response.write "<td>" & oRS2 ("Company" & "</td>"
response.write "<td>" & oRS2 ("region" & "</td></tr>"
oRS2.MoveNext
Loop
end if
oRS2.Close
set oRS2=Nothing
response.write "</table>"
%>
</font>
</body>
</html>
cheeeeers!
Gavin