set cn=server.createobject("ADODB.connection") dbpath=server.mappath("list.mdb") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &dbpath cn.open connstr
%>
<% dim count count=0 set rs=Server.CreateObject("ADODB.Recordset")
strsql="SELECT*FROM list Where word and title like'%"&Request("name")&"%'" rs. Open strsql,cn
If rs.EOF Then Response.Write "搜索结果:<BR><BR>" Response.write " 很抱歉!没有您要的关于<b>"&Request("name")&"</b>的文章 (请更换其他的关键字再试试!)"
End If
Set name1=rs("title") Set name2=rs("time") Set name3=rs("url") //这里为什么用NAME1,NAME2.NAME3来定义获取值我不是很清楚,有人能教一下我吗?要不怎么改?谢谢
Do Until rs.EOF Response.Write " <a href='"&name3&"'>"&name1&"</a> " Response.Write "("&name2&") <BR><BR>" count=count+1
rs.MoveNext Loop Response.Write"<BR><BR> <font color=RED>--共找到"&count&"片相关的文章--" rs.close cn.close %>