Discussion:
ADO recordset .Close statement causes "Operation is not allowed in this context"
(too old to reply)
Saul Jankelow
2004-12-07 15:32:31 UTC
Permalink
Please could someone help?

I have an ADO recordset that gets closed, and intermittenly I get the error

error no: 3219 "Operation is not allowed in this context"

I even changed the code to look like this:

282 If rsProposal.State = adStateOpen Then rsProposal.Close

but I still get this error:

'Date/Time: 2004-11-22 10:08:05
'Error : [3219] Operation is not allowed in this context.
'Message : save_Proposal on line no: 282 ??? on simple close.

Thanks

Saul
Alejandro Mesa
2004-12-07 15:39:05 UTC
Permalink
Try,

if not rsProposal is nothing then
If rsProposal.State = adStateOpen Then
rsProposal.Close
end if
end if



AMB
Post by Saul Jankelow
Please could someone help?
I have an ADO recordset that gets closed, and intermittenly I get the error
error no: 3219 "Operation is not allowed in this context"
282 If rsProposal.State = adStateOpen Then rsProposal.Close
'Date/Time: 2004-11-22 10:08:05
'Error : [3219] Operation is not allowed in this context.
'Message : save_Proposal on line no: 282 ??? on simple close.
Thanks
Saul
dance2die
2004-12-07 20:17:06 UTC
Permalink
Should "rsProposal.State = adStateOpen" be
rewritten as "rsProposal.State AND adStateOpen"
since "adStateOpen" is a flag switch?
Post by Alejandro Mesa
Try,
if not rsProposal is nothing then
If rsProposal.State = adStateOpen Then
rsProposal.Close
end if
end if
AMB
Post by Saul Jankelow
Please could someone help?
I have an ADO recordset that gets closed, and intermittenly I get the error
error no: 3219 "Operation is not allowed in this context"
282 If rsProposal.State = adStateOpen Then rsProposal.Close
'Date/Time: 2004-11-22 10:08:05
'Error : [3219] Operation is not allowed in this context.
'Message : save_Proposal on line no: 282 ??? on simple close.
Thanks
Saul
David Gugick
2004-12-07 22:12:01 UTC
Permalink
Post by dance2die
Should "rsProposal.State = adStateOpen" be
rewritten as "rsProposal.State AND adStateOpen"
since "adStateOpen" is a flag switch?
That's true, but only for asychronous calls. If you make synchronous
calls, the only possible settings are open and closed.
--
David Gugick
Imceda Software
www.imceda.com
Loading...