⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 browseinfo1.asp

📁 这是我做的毕业设计,企业管理系统.ASP连接SQL数据库,基本功能已经实现
💻 ASP
字号:
<% @ language="vbscript" %>
<HTML>
<HEAD>
<TITLE>查询设备资料</TITLE>
</HEAD>
<BODY bgcolor="#aabbaa">
<% 
if session("hy_id")=""  then
response.redirect "1.htm"
end if
%>
<font color="red" face="幼圆">
<p><a href="vod1.asp">返回首页</a>|
<% if session("level")>1 then%>
   <a href="editinfo.asp">修改资料</a>|
   <a href="addinfo.asp">添加资料</a>|
   <a href="deleteinfo.asp">删除资料</a>|
<% end if %></p>
<hr width="100%" noshade size="1" color="red">
</font>
<div align="center">
<form name="form1" method="post" action="browseinfo.asp">
<p>设备查询:
<select size="1" name="1stfld">
<option selected value="all">全部显示</potion>
<option selected value="equ_department">所在部门</potion>
<option selected value="equ_data">购买日期</potion>
<option selected value="equ_id">设备编号</potion>
<option selected value="equ_name">设备名称</potion>
</select>
&nbsp;&nbsp; 值:<input name="txtvalue" type="text" size="10">
&nbsp;&nbsp; <input name="btnsubmit" type="submit" value="查 询"></p>
</form>
<% 

dim cnn,rst,ssql,currentpage,rowcount,i
if request.querystring("currentpage")="" then
if request.form("btnsubmit")="" then
response.end
end if
end if
currentpage=request.querystring("currentpage")
if currentpage="" then
currentpage=1
end if
set cnn=server.createobject("adodb.connection")
set rst= server.createobject("adodb.recordset")
cnn.connectionstring="provider=sqloledb;data source=(local);"&_
"uid=sa;pwd=0335;database=vod"
cnn.open
rst.CursorType=adOpenStatic
rst.pagesize=8
field=trim(request.form("1stfld"))
value=trim(request.form("txtvalue"))
if field="all" then
ssql="select * from shebei order by equ_id"
end if
if field<>"all" and value<>"" then
ssql="select * from shebei where "&field&"='"&value&"' order by equ_id"
end if
if field<>"all" and value="" then
response.redirect"browseinfo.asp"
end if
rst.open ssql, cnn,1
if  rst.eof then
response.write"<p><font color=red>没有找到符合条件的记录!</font></p>"
else
'设置当前页号
rst.AbsolutePage=cint(currentpage)
rowcount=0
%>
<table border="1" width="78%">
<caption><b>查询结果:</b>共<%=rst.recordcount %>件设备
<tr>
<th width="200">设备号</th><th width="200">设备名称</th><th width="200">所属部门</th><th width="200">设备价格</th>
</tr>
<% while not rst.eof and rowcount<rst.pagesize %>
<tr>
<td><a href=detailinfo.asp?equ_id=<% =rst("equ_id") %>>
<% =rst("equ_id") %></a></td>
<td><% =rst("equ_name") %></td>
<td><% =rst("equ_department") %></td>
<td><% =rst("equ_value") %></td>
</tr>
<%
rowcount=rowcount+1
rst.movenext
wend
%>
</table>
<p>每页<% =rst.pagesize %>件设备&nbsp;
当前页次:<% =currentPage %>/<% =rst.pageCount %>页&nbsp;
<% for i=1 to rst.pagecount
if i=cint(currentpage) then %>
[<font color="red"><% =i %></font>]&nbsp;&nbsp;
<% else %>
[<a href="browseinfo.asp?currentpage=<% =i %>"><% =i %></a>]&nbsp;&nbsp;
<% 
end if
next
end if
%>
</p></div>
</body>
<html>

⌨️ 快捷键说明

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