♣
大家注意了,这是我对同一个问题连开的第三贴!1
原贴地址http://community.csdn.net/expert/topic/4178/4178651.xml?temp=.291897
谁能给出代码具体写在什么地方?代码是什么?解决问题后马上三贴连结!!
· 网友精彩回答:
第二次没传值!用你习惯session改,hehe
cx_ltx.asp
<html>
<head>
<title>数据库asp查询管理系统</title>
</head>
<body bgcolor="#d8edf8">
<body>
<%
dwbmcss=request.form("dwbmcs")
if dwbmcss<>"" then
session("dwbmcss")=dwbmcss
else
dwbmcss=session("dwbmcss")
end if
radio_button=request.form("radiobutton")
if radio_button<>"" then
session("radio_button")=radio_button
else
radio_button=session("radio_button")
end if
%>
<%="<p><center><font color=#cc3300><b>数据库查询结果</b></font></center><p>"%>
<%
psize=20
set conn=server.createobject("adodb.connection")
connstr="dbq="+server.mappath("ltxk.mdb")+";defaultdir=;driver={microsoft access driver (*.mdb)};"
conn.open connstr
if radio_button="zgbh" then
sql="select * from txzg where shbzh like %"& dwbmcss &"%" order by shbzh "
else
sql="select * from txzg where dwbm like %"& dwbmcss &"% order by dwbm "
end if
dim rs_main
set rs_main=server.createobject("adodb.recordset")
rs_main.open sql,conn,1,1
if rs_main.recordcount=0 then
response.write "<p><center>对不起数据库中没有相关信息!请重新输入查询条件</center></p>"
response.end
else
rs_main.pagesize=cint(psize)
end if
pagen=request("tempage")
if pagen="" then
pagen=1
end if
sa=request("coms")
if sa="上一页" then pagen=pagen-1 end if
if sa="下一页" then pagen=pagen+1 end if
if sa="确定" then pagen=request("p") end if
rs_main.absolutepage=pagen
response.write"<center>"
pagebegin=rs_main.pagesize*(pagen-1)+1
if rs_main.pagesize*pagen<rs_main.recordcount then
pagend=rs_main.pagesize*pagen
else pagend=rs_main.recordcount
end if
n=1
total=rs_main.pagecount
response.write "<p> <font color=#339966> <b>结果为:</b>"
response.write
"(共有"&rs_main.recordcount&"条符合条件的信息,分"&total&"页,显示第"&pagen&"页["&pagebegin&"-"&pagend
&"])</font></p>"
response.write "<table width=100% border=1 cellpadding=3 bordercolorlight=#000000
bordercolordark=#ffffff cellspacing=0 bgcolor=#a4d1e8>"
response.write "<tr bgcolor=#a4d1e8> <font
size=2><td><b>单位名称</b></td><td><b>单位编码<b></td><td><b>职工编号<b></td><td><b>姓名</
b></td><td><b>身份证号码</b></td><td><b>出生年月</b></td><td><b>工作年月</b></td><td><b>退
休费</b></td></font><tr bgcolor=#fffff>"
rc=rs_main.pagesize
do while not rs_main.eof and rc>0
if n=1 then
response.write "<tr bgcolor=#ffffff>"
else
response.write "<tr bgcolor=#eeeeee>"
end if
n=1-n
%>
<td><%=rs_main("dwmc")%></td>
<td><%=rs_main("dwbm")%></td>
<td><%=rs_main("zgbh")%></td>
<td><%=rs_main("xm")%></td>
<td><%=rs_main("shbzh")%></td>
<td><%=rs_main("csny")%></td>
<td><%=rs_main("gzny")%></td>
<td><%=rs_main("ltxfhj")%></td>
</tr>
<%
rc=rc-1
rs_main.movenext
loop
conn.close
set rs_main=nothing
set conn=nothing
%>
</table>
<form method=get action="cx_ltx.asp">
<input type="hidden" name=tempage value="<%=pagen%>">
<%
if pagen>1 then
response.write "<input type=submit name=coms value=上一页>"
end if
if pagen<>total then
response.write "<input type=submit name=coms value=下一页>"
end if
response.write "<br>"
response.write "显示第<input type =text name=p size=5>页"
response.write "<input type=submit name=coms value=确定>"
response.write "</form>"
%>
</body>
</html>
- 更多问题:
- · vc6调试时没有了响应?
- · 如何将字符串转换成控件类型
- · 求救呀上传文件太大后,页面出错如何做处理?
- · 请教有关两个表的连接操作
- · 肉食之害--请看完再评论
- · 没有人能给我详细的满意答复,这是我开的第二贴!!!
- · destructor莫名其妙出错
- · MSSQL2000 安装时出现的问题,急救
- · 新手提问.
- · 一个数据库同步的问题,感谢大家解答,比较有挑战性,必给分
- · 在用tc2.0进入图形方式的问题(百思不得其解)
- · 如何选择出指定行之间的纪录??大虾帮忙~
- · ACCESS与MYSQL数据库同步的问题!!必送分
- · SQL安装的时候出现这个问题,急救
- · ASP.NET web 应用程序如何调用其他程序
- · 如何用TImage的Canvas作一个点?

