Re: Handling Error in ADO



One more thing. I just noticed that the book I am using is for ADO 2.5 and
on
the list of recordset properties the STATE property is not listed, however
on
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


.