天津网站建设 http://www./
数据库没法放上去 ,因为关系到一些商机问题 我只把代码贴出来, 麻烦大家给看看, <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% set conn=server.CreateObject("adodb.connection") connstr="driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("../kh.mdb") conn.open connstr %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> </head> <script language="javascript"> function oo() { var text=document.form1.cname.value;
if(text!=""){ window.location="?ac="+text; }
} function selected() { var str=document.form1.dd.options[document.form1.dd.selectedIndex].value; window.location='aa.asp?id='+str;
} </script> <body> <form name="form1" method="post" action=""> <input name="cname" type="text" id="cname2" size="50" value="<%=request.QueryString("ac") %>" onPropertyChange="oo()"> <% session("ac")=request("ac") ac=session("ac") if ac<>"" then j=len(ac) for i=1 to j sstr=sstr&"or cname like '%"&mid(ac,i,2)&"%' " next sql="select * from khzl where cname like '%"&ac&"%'"&sstr 'response.Write sql set rss=server.CreateObject("adodb.recordset") rss.open sql,conn,3,2 if not rss.eof then%> <br> <select name="dd" onChange="selected()"> <% do while not rss.eof %> <option value="<%= rss(0) %>"><%=rss(1) %>-<%= rss(2) %></option> <% rss.movenext loop %> </select> <% End If rss.close set rss=nothing end if %> </form> </body> </html>