Re: Handling Error in ADO
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Tue, 20 Feb 2007 16:00:50 -0000
One more thing. I just noticed that the book I am using is for ADO 2.5 andon
the list of recordset properties the STATE property is not listed, howeveron
my code I am referencing ADO 2.8 and it has a STATE property. Thank you<>
again. Now, on your test you use ((rs.State And adStateOpen) <> 0), could
you explain why the double test (rs.State and adStateOpen). Is it to be
really sure that it is open before trying to close it? Wouldn't (rs.State
0) be enough?
No. Becasuse State records other bits that might be set, that technically
are othogonal to being open.
State could be one or bits set of
adStateClosed 0 Object is closed
adStateConnecting 2 Object is connecting
adStateExecuting 4 Object is executing
adStateFetching 8 Object is fetching
adStateOpen 1 Object is open
Mind you, if the RecordSet was Fetching or Executing or Connecting, could
you close it in the midst of these actions?
I am not sure. Some of these occur if you request asynchronous action.
I think if the State is Open you are in a postion to Close, with the others
I have no idea.
Cheers
Stephen Howe
.
- Follow-Ups:
- Re: Handling Error in ADO
- From: Mark J. McGinty
- Re: Handling Error in ADO
- References:
- Re: Handling Error in ADO
- From: Stephen Howe
- Re: Handling Error in ADO
- From: HLong
- Re: Handling Error in ADO
- Prev by Date: Re: Handling Error in ADO
- Next by Date: derived field problem
- Previous by thread: Re: Handling Error in ADO
- Next by thread: Re: Handling Error in ADO
- Index(es):