ADO: Object was open
- From: Learning Curve <localharbor@xxxxxxxx>
- Date: Thu, 10 Jul 2021 17:02:27 -0700 (PDT)
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.
.
- Follow-Ups:
- Re: Object was open
- From: Bob Barrows [MVP]
- Re: Object was open
- Prev by Date: Re: MSSQL Server Compact Edition 3.5. OleError 0x80040E05 - Object was open during Recordset.Open for certain tables
- Next by Date: Re: Object was open
- Previous by thread: MSSQL Server Compact Edition 3.5. OleError 0x80040E05 - Object was open during Recordset.Open for certain tables
- Next by thread: Re: Object was open
- Index(es):
Relevant Pages
|