请教一下 多关键字搜索的一个问题
<% set conn = server.CreateObject("adodb.connection")
conn.open "dbq="&server.MapPath("gs.mdb")&";driver={microsoft access driver (*.mdb)}"
setok = request("jian")
if trim("setok") = "" then
response.Write "<script>alert('请输入关键字');history.back();</script>"
response.End
end if
setok = rtrim(ltrim(setok))
setok2 =split(setok," ")
max=ubound(setok2)
for i=0 to max
if i = 0 then
sql1=sql1&" (key like '%" & setok2(i) & "%' and "
else
if i = max then
sql1=sql1&" key like '%" & setok2(i) & "%') "
else
sql1=sql1&" key like '%" & setok2(i) & "%' and "
end if
end if
next
sql = "select * from yuangong where "&sql1&" "
response.Write sql
%>
<p><span class="STYLE1">姓名</span>: <%=rs("xingming")%> </p>
<p><span class="STYLE1">年龄</span>: <%=rs("nianling")%> </p>
<p><span class="STYLE1">户籍</span>: <%=rs("huji")%> </p>
<p><span class="STYLE1">学历</span>: <%=rs("xueli")%> </p>
<p><span class="STYLE1">职位</span>: <%=rs("zhiwei")%> </p>
<p><span class="STYLE1">电话</span>:<%=rs("lianxi")%> </p>
<p><span class="STYLE1">履历</span>:<%=rs("jingli")%> </p>
请教一下 我如何让上面的代码显示出我搜索的内容 现在还显示不出数据库的内容
需要怎么改一下 谢谢大家