Numerous web searches indicate that this is an old prob: I was having
trouble using ADO and getting "object was open" errors.
FWIW, and in case this bug bedevils others in the future, I eventually
found a solution in my own case by setting my ADO's Command->Name
property to a unique value for each sql stmt that I use. Apparently in
some way my ADO needs this in order to function reliably.
Also fwiw, merely setting the Name property then *also* crashed my pgm
- it was really just not my day, I guess - until I set the property by
using a technique of first copying the unique name value to a _bstr_t,
then using an assignment of the form Command-
>Name.Assign(_bstr_t.GetBSTR());
Hope this helps anyone else who trips over the prob. Took me longer
than I care to admit to get this far, and if anyone else ever posted
the above approach, I never did see it.


|