<%Set rs = Server.CreateObject("ADODB.Recordset")
if request.Form("mingcheng") <> "" or Request.Form("mingcheng")<>"" then
if Request.Form("mingcheng")="" then
response.write"<script>alert('您输入资料是空的!');history.go(-1)</script>"
response.end
else
if request.Form("Submit") <> "" or Request.Form("mingcheng") <> "" then
str="select 电话,单位名称 from reg where 单位名称 like '%"&Request.Form("mingcheng")&"%' "
rs.Open str,conn,1,1
if rs.bof and rs.eof then
response.write "没有符合条件的号码,请重新输入关键字查询"
response.end()
response.write "<script>history.back();</script>"
else
sql="select 电话,单位名称 from reg where 单位名称 like '%"&Request.Form("mingcheng")&"%' "
call q(sql)
end if
end if
end if
end if
%>
调用的q代码
<%
sub q(inputquery)
connstr="driver={Microsoft Access Driver (*.mdb)};DBQ=" &Server.MapPath("date/missme.mdb")
set cn=server.createobject("adodb.connection")
cn.open connstr
set rstemp=cn.execute(inputquery)
howmanyfields=rstemp.fields.count-1
%>
<center><table border=1></center><tr>
<%
for i=0 to howmanyfields
%>
<td><b>
<%=rstemp(i).name%></b></td>
<%next%>
</tr>
<%
dim count
count = 0
do while not rstemp.eof
count = count + 1
%>
<tr>
<% for i=0 to howmanyfields
thisvalue=rstemp(i)
if isnull(thisvalue) then
thisvalue=""
end if
%>
<td valign="top"><%=thisvalue%></td>
<% next %>
</tr>
<%rstemp.movenext
loop%>
</table>
<%
response.write("<br>记录总数:" & count)
rstemp.close
set rstemp=nothing
cn.close
set cn=nothing
end sub%>
请问怎样更改实现此功能,谢谢!
1 个解决方案
#1
<a href="tel:13812341324">13812341234</a>
#1
<a href="tel:13812341324">13812341234</a>