大家来看看,问题有点奇怪喔!

yxh8259 2003-02-13 09:58:50
<body>

<%wyhh=request.form("yhh")%>

<%
Set conn=Server.CreateObject ("ADODB.Connection")
connStr="DSN=zyydgl;Database=zyydgl;UID=;PWD=;"
conn.Open connStr
Set rs=Server.CreateObject ("ADODB.RecordSet")
rs.CursorType = adOpenStatic
tempSQL="select yhh,yhm,yddz,yyhh from df_yhjbxx where yhh='"&wyhh&"'"
rs.Open tempSQL,conn
%>

<p align="center">记录</p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="25%"><font color="#FF0000">帐号:<%=rs("yhh")%></font></td>
<td width="46%">户名:<%=rs("yhm")%></td>
<td width="29%">卡号:<%=rs("yyhh")%></td>
</tr>
<tr>
<td width="100%" colspan="3">地址:<%=rs("yddz")%></td>
</tr>
<tr>

<td width="100%" colspan="3">表号:</td>
</tr>
</table>
<hr color="#0000FF">

<%
wnian=request.form("nian")
wyue=request.form("yue")
%>

<%
Set conn2=Server.CreateObject ("ADODB.Connection")
connStr2="DSN=zyydgl;Database=zyydgl;UID=;PWD=;"
conn2.Open connStr
Set rs2=Server.CreateObject ("ADODB.RecordSet")
rs2.CursorType = adOpenStatic
tempSQL2="select yhh,cbrq,zdl,zdf from df_zdf_ls where yhh='"&wyhh&"' order by cbrq desc"
rs2.Open tempSQL2,conn2
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<tr>
<td width="8%" align="center">月份</td>
<td width="8%" align="center">计费</td>
<td width="8%" align="center">应交</td>
<td width="8%" align="center">实交</td>
<td width="8%" align="center">未交</td>
<td width="8%" align="center">收费日期</td>
</tr>
<%
WHILE NOT rs2.EOF
%>
<tr>
<td width="8%" align="center"><%=rs2("cbrq")%> </td>
<td width="8%" align="center"><%=rs2("zdl")%>  </td>
<td width="8%" align="center"><%=rs2("zdf")%> 元 </td>
<td width="8%" align="center"> </td>
<td width="8%" align="center"> </td>
<td width="8%" align="center"> </td>
</tr>
<%
rs2.MoveNext
WEND
%>
</table>

</body>

运行时记录不能全部显示,有的可显示一条,有的可显示几条,有的一条也显示不了
(用PB运行SQL语句没问题,我怀疑是PWS的问题,由于客观原因我的机器不能装WIN2000。没用IIS试过),出现错误提示如下:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80020009'

多步 OLE DB 操作产生错误。请检查每个 OLE DB 状态值。没有工作被完成。

?

...全文
32 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yxh8259 2003-02-19
  • 打赏
  • 举报
回复
还是不行!!!!!!!!
ChaoHan 2003-02-18
  • 打赏
  • 举报
回复
rs.Open tempSQL,conn改为rs.Open tempSQL,conn,1,3
rs2.Open tempSQL,conn改为rs2.Open tempSQL,conn,1,3

试一试吧!希望有用!
yxh8259 2003-02-18
  • 打赏
  • 举报
回复
按你们说的改了.问题仍然存在!!!!!!!!!!!!!!!!!!!!!!!!!!!
saidong 2003-02-13
  • 打赏
  • 举报
回复
呵呵,数据库数据连接与记录的用完即释放,可是个不容忽视的问题。即算程序不出问题,就微软那破内存管理方式,一会IIS就老牛拉车了!
逍遥小贼 2003-02-13
  • 打赏
  • 举报
回复
<body>

<%wyhh=request.form("yhh")%>

<%
Set conn=Server.CreateObject ("ADODB.Connection")
connStr="DSN=zyydgl;Database=zyydgl;UID=;PWD=;"
conn.Open connStr
Set rs=Server.CreateObject ("ADODB.RecordSet")
rs.CursorType = adOpenStatic
tempSQL="select yhh,yhm,yddz,yyhh from df_yhjbxx where yhh='"&wyhh&"'"
rs.Open tempSQL,conn
%>

<p align="center">记录</p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="25%"><font color="#FF0000">帐号:<%=rs("yhh")%></font></td>
<td width="46%">户名:<%=rs("yhm")%></td>
<td width="29%">卡号:<%=rs("yyhh")%></td>
</tr>
<tr>
<td width="100%" colspan="3">地址:<%=rs("yddz")%></td>
</tr>
<tr>

<td width="100%" colspan="3">表号:</td>
</tr>
</table>
<hr color="#0000FF">

<%
rs.close
wnian=request.form("nian")
wyue=request.form("yue")
%>

<%

Set rs2=Server.CreateObject ("ADODB.RecordSet")
rs2.CursorType = adOpenStatic
tempSQL2="select yhh,cbrq,zdl,zdf from df_zdf_ls where yhh='"&wyhh&"' order by cbrq desc"
rs2.Open tempSQL2,conn2
%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<tr>
<td width="8%" align="center">月份</td>
<td width="8%" align="center">计费</td>
<td width="8%" align="center">应交</td>
<td width="8%" align="center">实交</td>
<td width="8%" align="center">未交</td>
<td width="8%" align="center">收费日期</td>
</tr>
<%
WHILE NOT rs2.EOF
%>
<tr>
<td width="8%" align="center"><%=rs2("cbrq")%> </td>
<td width="8%" align="center"><%=rs2("zdl")%>  </td>
<td width="8%" align="center"><%=rs2("zdf")%> 元 </td>
<td width="8%" align="center"> </td>
<td width="8%" align="center"> </td>
<td width="8%" align="center"> </td>
</tr>
<%
rs2.MoveNext
WEND

rs2.close
set conn=nothing
%>
</table>

</body>
aqy_19781228 2003-02-13
  • 打赏
  • 举报
回复
因为你调用了两次数据库,当你用完一个rs后,马上把它关掉试试

28,391

社区成员

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

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