I am getting the following error in my classic asp application:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Transaction cannot have multiple recordsets with this cursor type. Change the cursor type, commit the transaction, or close one of the recordsets.
i am working on migrating the code from Oracle to SQL Server 2008, and this is an issue that i keep seeing here and there, all through out the application.
can't seem to find any fixes for it.
this particular case in this block of code: (i changed the selects to make them shorter)
Set MyConn = Server.CreateObject("ADODB.Connection")
Call OpenORPSConnect(MyConn)
ql = "Select username from mytable"
set rs = MyConn.Execute(sql)
if not rs.EOF then username = rs(0)
if username = "" then username = theUser
rs.close()
set rs = nothing
MyConn.BeginTrans()
sql = "Select someReport from MyTable"
set rs = MyConn.Execute(sql)
do while not rs.EOF
TIMESTAMP = rs("TIMESTAMP")
rev = rs("REV")
select case whatChange
case "Target date"
sql = "Insert into " & caJustTable & _
" (TEXT, TIMESTAMP, CURRENTFLAG)" & _
" Values ( Text& "','" & COPY_TS & "', 'Y')""
MyConn.Execute(sql)
end select
sql = "update table, set this to that"
MyConn.Execute(sql) <-------- error happens here sometimes....
end if
rs.movenext
loop
rs.close()
set rs = nothing