ASP与后台

来源:百度知道 编辑:UC知道 时间:2024/06/27 05:58:01
我删除删除留言本的信息就出现
ADODB.Recordset 错误 '800a0bcd'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/hshwz/qiuqiu/index.asp,行 250
以下代码要怎么修改才看不到以上的信息
<%
If Request.form("Ok") = " Ok " Then
RS.Addnew
RS("TITLE")=Request.form("Title")
RS("TEXT")=Request.form("diary")
RS("WEATHER")=Request.form("Weather")
if Request.form("Open")=1 then
RS("OPEN")=Request.form("Open")
else
RS("OPEN")=0
end if
RS.Update
RS.Close
Set RS=Nothing
Response.Redirect("index.asp?diary=1")
End if
If Request.form("delete") <>"" Then
SQL="delete from diary where id=" & Request.form("delete")
ConnObj.Execut

If Request.form("delete") <>"" Then 改成
If isnumeric(Request.form("delete")) and trim(request.form("delete"))<>"" Then
我觉得你最好在删除之前(ConnObj.Execute(SQL) )最好先判断记录是否存在。