asp修改代码,懂得进,谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/15 17:54:52
住房公积金查询

我把公积金管理软件中的数据导出来后做网站查询。主要是通过身份证和姓名 或者账户和姓名查询 ,只有身份证和姓名都正确,或者账号和姓名正确才能查 询出结果。

新问题:

如果数据库中每个人只有一条记录时,查询没有问题。但由于有些人有几个单位 工作过,在数据库中都有记录,而且每个单位都有余额,但最终个人没有累计数 ,所以把这个人的所有记录都查询出来就正确了

但我的程序只能查询出一条记录来,即使数据库中有若干条,它也只显示一条。
<!--#include file=conn.asp -->
<head>
<meta http-equiv="Content-Type" content="text ml; charset=gb2312" />
<title>住房公积金个人账户查询</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
color: #000000;
font-weight: bold;
}
.STYLE2 {color: #003300}
.STYLE3 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</head>
<body>

<%
dim shengfeng2
dim name2
searchtype=request.form("type")
if searchtype=1 then<

因为你查询的记录集没有循环读取数据,当然只有一条了.
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
IF rs.eof Then
response.Redirect("err.asp")
else
----------------------------------
这里加一个循环读取代码
while not rs.eof
.
.
.
.
.
这里加一个循环体代码
<%rs.movenext
wend
------------------

end if
rs.close
set rs=nothing
%>