hi
i am trying to develop a simple job search page. for that i am trying to execute a simple form based search based on two drop downs 1) category 2) location with my ms access database. the db has just one table "jobs" and that has following fields
no (auto inc.), title (text), description (text), category (text), location (text)
here is my form code (listing.asp)
Quote:
<body>
<form id="form1" name="form1" method="post" action="search.asp">
<label>Select Category
<select name="cat" id="cat">
<option>Fund Management</option>
<option>Banking and Finance</option>
<option>Consulting</option>
<option>Commerce and Industry</option>
<option>Legal</option>
</select>
</label>
<label>Select Location
<select name="loc" id="cat">
<option>Africa</option>
<option>Hong Kong</option>
<option>Pakistan</option>
<option>Saudi Arabia</option>
<option>Singapore</option>
<option>United Kingdom</option>
<option>United States</option>
</select>
</label>
<input type="submit" name="submit" id="submit" value="Search" />
</form>
</body>
|
the search.asp has the following code
Quote:
<body>
<%
Dim conn
Dim rs
Dim strCat, strLoc
strCat = Request.Form("cat")
strLoc = Request.Form("loc")
'Response.Write strCat
'Response.Write strLoc
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "job"
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM jobs " &_
"WHERE category = strCat " &_
"AND location = strLoc " &_
"ORDER BY category "
rs.Open sql, conn
'set rs = conn.execute(sql)
'if not rs.eof
conn.close
%>
</body>
|
and thats pretty much it...i do not know where to go from here :( please help.