<% qycx=request.FORM("qycx") cx="企业名称 like '%"&qycx&"%' " Set conn=Server.CreateObject("adodb.connection") 'conn.Open "dsn=qycxsjk;uid=;pwd=;database=data.mdb" conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("qycx.mdb") sql="select * from info where "&cx&"" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 do while not rs.eof %> <%qymc=rs("企业名称") id=rs("id") %> " ><%Response.write qymc%>
<% rs.movenext loop rs.close %>
上饶工商信息网
<% Function uni(Chinese) For i = 1 to Len (Chinese) a=Mid(Chinese, i, 1) uni=uni & "" & Hex(Ascw(a)) & ";" next End Function %> ================================================= 第二点评:看到这里,我有点汗,刚开始以“企业名称”做为关键字提交,后来才想到以ID为关键字进行查询避免了汉字提交的问题。这么基础一个问题,我居然琢磨了大半天。这里根据hello.asp提交的“企业名称”关键字查询得到所有“企业名称”字段中含有该关键字的企业全称(以免重复),做一个列表,点击将入第三个页面,即该企业详细资料。 三、qycx2.asp 源码如下: <%@ Language=VBScript %> <% Response.ContentType = "text/vnd.wap.wml" %>
<% name=request.querystring("id") sql="select * from info where id="&name&"" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 do while not rs.eof %> <%qymc=rs("企业名称")%> 企业名称:<%Response.write qymc%>