When the object does not allow the closure of operations

SOS help errant code Data

<%
dim rf
'pop-up prompts on the client news
sub msgboxU (str)
response.write ( ” msgbox” & chr (34) & str & chr (34) & ” “)
end sub
%>

<%
dim conn, dbpath
set conn = Server.CreateObject (” adodb.connection “)
dbpath = “mdb /”
conn.open “DRIVER = Driver do Microsoft Access (*.mdb); DBQ =” & Server.MapPath (dbpath & “xja.mdb”)
%>

<%
dim rst, sql, rst1, sql1, id
set rst = server.createobject ( “adodb.recordset”)
set rst1 = server.createobject ( “adodb.recordset” )
%>
<%
function cutstr (str, length, addstr)
if len (str) <length then
cutstr = str
else
cutstr = left (str, length) & addstr
end if
end function
%>

<%
if request.QueryString (” act “) =” modify “Then
if request.form (” ff_title “)=”” or request.form ( “ff_content “)=”” then
msgboxu” Please enter a complete “
else
on error resume next
sql = “select * from tb_news where t_nid = '” & request.querystring ( “id “)&”'”
conn.begintrans
rst.open sql, conn, 2,3
rst ( “t_ntitle”) = request.Form ( “ff_title”)
rst ( “t_ncontent”) = request.Form ( “ff_content”)
rst.update
rst.close
if err.number 0 then
conn.rollbacktrans
msgboxu “Notice the failure to amend” & err.description
err.clear
else
conn.committrans
msgboxu “notice to amend success!”
end if
end if
end if

%>

<%
rst.open “select * from tb_news “, conn, 2,3
do while not rst.eof
response.Write”

“&”

“&”


rst.movenext
loop
rst.close
%>
<%
set rst = nothing
set rst1 = nothing
conn.close
set conn = nothing
%>

Leave a Reply