该站点在帮助解决许多未知问题方面非常有用。谢谢你。现在我有一个未知数,我无法找到答案。
错误是:
ADODB.Recordset 错误“800a0e78”
对象关闭时不允许操作。
我在用着:
- ASP 经典
- 微软 SQL 服务器 2000
在 ASP 中有<textarea>
一个“表单”来插入注释,当插入注释并按下提交按钮时,存储过程将注释插入注释表 datetimestamp 并添加登录用户。这正是它要做的事情。此外,在 ASP 中,还有一个<table>
用注释、日期时间戳和登录用户填充其他先前条目。这也正是在做它应该做的事情。
上面提到的错误发生在按下提交按钮时,当错误页面出现时点击浏览器的返回按钮,然后刷新页面<textarea>
被清除并注意,日期时间和登录用户显示在<table>
ASP 经典页面:
Dim rsAccountNote
<form name="Accountnote" method="post" action="/admin/xt_Accountnote.asp">
<td>
<b>Add Note:</b><br />
<textarea type="text" name="notes" value="" rows="7" cols="43" style="resize: none;"></textarea><br />
<input type="submit" value="Add new note"/>
</td>
<table>
<tr>
<td>
<b>Read Notes:</b>
</td>
</tr>
<%
set rsAccountNote = DBConn.Execute("SELECT AccountNotes, LogonUser_Id, dtAccountNotedatetime FROM AccountNotes WHERE AccountId = " & rsAccount("AccountId"))
rsAccountNote.Sort="dtAccountNotedatetime DESC"
Do While Not rsAccountNote.EOF
%>
<tr>
<td>
Added <%=rsAccountNote("dtAccountNotedatetime")%> by <%=rsAccountNote("LogonUser_Id")%>
</td>
</tr>
<tr>
<td>
<b>Note: </b> <%=rsAccountNote("AccountNotes")%>
</td>
</tr>
<%
rsAccountNote.MoveNext
Loop
Set rsAccountNote = Nothing
%>
</tr>
</td>
</tr>
</table>
</form>
ASP 经典 xt_page:
<%
Dim rsAccount
Dim iAccount
Dim LogonUser_id
Dim AccountNotes
sSQL = "exec spApp_UpdateAccountNotes " & _
"@iAccount = " & Trim(Request("Account_id")) & ", " & _
"@AccountNotes = " & prepString(Request("AccountNotes")) & ", " & _
"@LogonUser_id = " & prepString(Request("Logon_User"))
Call resultQuery(DBConn, rsAccount, sSQL, "", true)
Response.Redirect("/Account_admin/accountinfo.asp?account_id=" & Trim(Request("account_id")))
%>
存储过程:
CREATE PROCEDURE spApp_UpdateAccountNotes
(
@iAccount int,
@LogonUser_id varchar (50),
@AccountNotes varchar(5000)
)
AS
SET NOCOUNT ON
insert AccountNotes
(
AccountId,
LogonUser_Id,
AccountNotes
)
values
(
@iAccount,
@LogonUser_Id,
@AccountNotes
)
GO