I am new to ASP and I am learning from a book I recently
borrowed. I am having some problems with some of the code that is in
the book, this is the code. Which is meant to search an access
database, according to some values that get entered.
<HTML>
<BODY>
<%
if session("yes")=1 then
session("x")=request("keyword")
session("y")=request("cont")
session("yes")=2
end if
x=session("x")
y=session("y")
'Insertion point for part 2
query ="select id,type, location, brief,verbose, email, wages
from employ where (cont='"&y&"') and (type like '%"& x
& "%' or location like '%"& x & "%' or brief like'%"& x
& "%' or verbose like'%"& x & "%' or email like'%"& x
& "%' or wages like '%"& x &"%')"
set database=server.createObject("ADODB.Connection")
database.open "jobs"
Set RSList=server.CreateObject("ADODB.recordset")
RSList.open query,database,3
dim numpages
dim currentpages
RSList.pagesize=10
if request.querystring("page")="" then
currentpage=1
else
currentPage=CInt(request.querystring("page"))
end if
numpages =rslist.PageCount
If CurrentPage > numpages then currentPage = numpages
If currentPage < 1 then numpages =1
if numpages =0 then
%><CENTER><B><%
response.write "No jobs match your search criteria. Please try again"
%></br><BR><BR><A HREF="title.asp">Back to Search</A></center><%
respnse.end
end if
s="The search criteria you entered returned"
if y="yes" then
n="contract"
else
n="permanent"
End if
c=rslist.recordcount
s=s+" "+cstr(c)+" " +n+" "
if c<>1 then
s=s+"jobs"
elseif c=1 then
s=s+"job"
end if %><font color="blue"><%
response.write("<center>" +s)
RSList.AbsolutePage=currentpage
%>
<BR><HR>
<FONT SIZE="7" COLOR="blue"><B>
<table border=0 width=98% cellspacing=1>
<tr>
<th>Type</th>
<th>Location</th>
<th>Description</th>
<th>Wages</th>
</B>
</tr>
</FONT>
<%
dim numrows
numrows =0
do until rslist.eof or numrows >=RSlist.PageSize
aa=RSlist("type")
ab=RSList("location")
ac=RSlist("brief")
ad=RSList("wages")
%>
<tr>
<td><%=aa%></td>
<td><%=ab%></td>
<td><A HREF="jobdetails.asp?ID=<%=rslist("ID")%>"><%=ac %></a>
</td>
<td><%=ad%></td>
<%
rslist.movenext
numrows=numrows+1
loop
%>
</table>
<hr><br><CENTER>
<!-- Insertion part 4 -->
<% if currentpage>1 then %>
<A HREF="process.asp?page=<%=currentpage-1%>"> Previous Jobs</A>
<%
end if %>
<BR><BR>
<A HREF="title.asp">Back to search</A>
<%
rslist.close
set rslist=nothing
database.close
set database =nothing
%>
</center>
</BODY>
</HTML>
|
when I try and execute this page, which is being called from another
page, when I enter a search criteria. I am getting the following output
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
/job/process.asp, line 20
Line 20 of the code is the highlighted one above which is : -
RSList.open query,database,3
What does this mean, and how do I correct it . I looked in google and there were some answers but they confused me even more