queryresult.asp

来自「功能不是很全面,需要自己修改和添加.尊重作者版权,希望大家相互学习,提出意见和建」· ASP 代码 · 共 60 行

ASP
60
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="conn.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link  rel="stylesheet" type="text/css" href="main.css"/>
<title>查询显示页面</title>
<style type="text/css">
<!--
body {
	background-image: url(images/5.jpg);
}
.style1 {color: #FF00FF}
-->
</style></head>

<body>
<h3>查询结果</h3>
<h4 align="right"> <a href="index.asp" class="style1">返回首页</a></h4>
<table width="85%" border="0" align="center">
  <tr>
    <td><div align="center">部门名称</div></td>
    <td><div align="center">部门类型</div></td>
    <td><div align="center">部门负责人</div></td>
    <td><div align="center">办公地址</div></td>
    <td><div align="center">联系电话</div></td>
	
  </tr>
<% 
dim searchkey,searchtype
set rs=server.CreateObject("adodb.recordset")
searchkey=request("searchkey")
searchtype=request("type")
sql="select * from XzDepart where XzName like '%"&searchkey&"%' and DepartTypeName='"&searchtype&"'"
rs.open sql,conn,1,1
do while not rs.EOF
%>
  <tr>
    <td><div align="center"><a href="resultdepart.asp?id=<%=rs("ID")%>"><span style="color:#FF0000; font-weight:bold;"><%=rs("XzName")%></span></a></div></td>
    <td><div align="center"><%=rs("DepartTypeName")%></div></td>
    <td><div align="center"><%=rs("XzJoin")%></div></td>
    <td><div align="center"><%=rs("XzAdd")%></div></td>
    <td><div align="center"><%=rs("XzTel")%></div></td>
  </tr>
  <%
  rs.movenext
  loop
  if rs.eof And rs.bof then
  Response.Write "<p align='center' id='time'> 没有找到相关数据!</p>"
  end if 
  rs.close
  set rs=nothing
%>
</table>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?