请教asp查询问题

苦行人76 2009-12-11 10:35:23
<!--#include file="include/CONN.ASP" -->
<%
call chklogin
if request("action")="" then
%>

<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="include/css.css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url(images/main_1.gif);
}
.style1 {
font-size: 14pt;
font-weight: bold;
}
-->
</style>

<title>查询</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" >
<tr>
<td><table width="800" border="0" align="center" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td class="style1"> <div align="center">查询</div></td>
</tr>
<tr>
<td> </td>
</tr>

<%

%>
<tr>
<td><table width="300" border="1" align="center" cellpadding="0" cellspacing="1">
<form name="form" action="search.asp?action=search" method="post">
<tr>
<td><div align="center">电话:</div></td>
<td>
<input name="dianhua" type="text" id="dianhua" size="15" maxlength="15">
<input type="submit" name="Submit" value="搜索">
</td>
</tr>
</form>
</table>
<p> </p>
</td>
</tr>

<%
if request("action")="search" then
%>
<tr>
<td class="style1"><div align="center">列表</div></td>
</tr>
<tr>

<td><table width="700" border="1" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="20%" height="25"><div align="center" class="style1">姓名</div></td>
<td width="20%"><div align="center" class="style1">电话</div></td>
<td width="20%"><div align="center"><span class="style1">日期</span></div></td>
<td width="20%"><div align="center"><span class="style1">分类</span></div></td>
</tr>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from [tel_dhmx] where dianhua='"&trim(request("dianhua"))&"'"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
else
do while not rs.eof
%>
<tr>
<td><div align="center"><%=rs("kehu")%></div></td>
<td><div align="center"><%=rs("dianhua")%></div></td>
<td><div align="center"><%=rs("riqi")%></div></td>
<td><div align="center"><%=rs("kffl")%></div></td>
</tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
end if
%>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%end if%>
...全文
44 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yan11cn 2009-12-11
  • 打赏
  • 举报
回复
<%
if request("action")="search" then
%>
你把这句改成
<%
else if request("action")="search" then
%>
再试试
苦行人76 2009-12-11
  • 打赏
  • 举报
回复
什么意思啊,没看懂,能说的详细一点吗
yan11cn 2009-12-11
  • 打赏
  • 举报
回复
你把if request("action")="search" then
写在if request("action")="" then里面了
苦行人76 2009-12-11
  • 打赏
  • 举报
回复
点查询后,页面什么都没有了
yan11cn 2009-12-11
  • 打赏
  • 举报
回复
问题具体是什么呢 报什么错误?
zjwhq 2009-12-11
  • 打赏
  • 举报
回复
你要问的是什么?光贴个代码出来

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧