存储过程问题,高手求救

cnn.begintrans
On Error Resume Next

cnn.execute( "insert into idb_productindent (productindent_number,productindent_type,productindent_user,productindent_state,productindent_user1,productindent_port1,productindent_port2,productindent_shiptime,productindent_shipping,productindent_transport,productindent_price,productindent_payment,productindent_userremark,productindent_on) values ('"&productindent_number&"','"&productindent_type&"','"&productindent_user&"','"&productindent_state&"','"&productindent_user1&"','"&productindent_port1&"','"&productindent_port2&"','"&productindent_shiptime&"','"&productindent_shipping&"','"&productindent_transport&"','"&productindent_price&"','"&productindent_payment&"','"&productindent_userremark&"','"&productindent_on&"')")

set rs5=cnn.execute("select max(productindent_id) as ttt from idb_productindent where productindent_user="&user_id&"")
productindent_id=rs5("ttt")

cnn.execute("update idb_productindent set Online_on='1',Online_no="&productindent_id&" where Online_on='0' and Online_user="&user_id&" and Online_type='1'")

If Err.Number<>0 Then
cnn.rollbacktrans
Response.write "发生错误:"&Err.Description
Response.end
End If
if cnn.Errors.count>0 then
cnn.rollbacktrans
response.write "SQL发生错误"
Response.end
end if
cnn.committrans

执行后报错为:发生错误:在事务中,不能存在此光标类型的多记录集。或更改光标类型、提交事务,或关闭其中一记录集。

删除
cnn.execute("update idb_productindent set Online_on='1',Online_no="&productindent_id&" where Online_on='0' and Online_user="&user_id&" and Online_type='1'")
这行就正常了。

请大家帮忙指出原因,解决立刻给分!!!谢谢啦:)
---------------------------------------------------------------

try

set rs5=cnn.execute("select max(productindent_id) as ttt from idb_productindent where productindent_user="&user_id&"")
productindent_id=rs5("ttt")

rs5.close() 'close the recordset first

cnn.execute("update idb_productindent set Online_on='1',Online_no="&productindent_id&" where Online_on='0' and Online_user="&user_id&" and Online_type='1'")

Published At
Categories with Web编程
comments powered by Disqus