asp+access如何实现简单搜索

如何实现查询产品型号直接显示产品名称的链接,不需要显示其它东西,如何解决,请帮帮忙... 如何实现查询产品型号直接显示产品名称的链接,不需要显示其它东西,如何解决,请帮帮忙 展开
 我来答
fyxiaowan
2009-03-09 · TA获得超过143个赞
知道小有建树答主
回答量:260
采纳率:37%
帮助的人:139万
展开全部
<form action="你的查询显示结果页面.asp" Method="POST" id="form1" name="form1">
<TABLE style="margin: 15 0 10 0px" width="629">
<TR>
<TD align="right">
<table>
<tr>
<td>
输入产品型号:
</td>
<td style="padding: 0 0 0 3px"><input type="text" name="Find" value="" style="width:160px"></td>
<td>
<input type="submit" name="Submit" value="搜索">
</td>
</tr>
</table>
</TD>
</TR>
</TABLE>
</form>
===================================================================下面的页面是显示查询结果的页面:
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("example3.mdb")
%> '数据库存连接
dim search,word,exec
word =trim(request.form("Find"))'关键字
if word="" then
response.Write("<script language='javascript'>window.alert('请输入您要搜索的关键字');history.back(-1);</script>")
response.End()
end if
exec="select * from 数据库表名 where title like '%"&word&"%' order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1'如果需要更新记录最后的"1"改成"3"
%>
<% if rs.eof and rs.bof then
response.write "<script language=""javascript""> "
response.write "alert(""记录不存在!""); " response.write "top.location='new_ish_news.asp';"
response.write "</script> "
response.End()
else
response.write rs("title(这是产品名称)")%>
如需链接加个<a href="">就可以了.
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式