Re: Closing recordset generates exception




When the update fails I get a descriptive message but I an other error
"operation not allowed in this context" is thrown up when the
rs.Close() is issued. Any idea why is this happening?

Your RecordSet Open is deficient.
The RecordSet will be being open in ReadOnly mode as that is the default
LockType.
Naturally that will prevent an Update().

For this:

rs.Open("AANWREG", Conn)

is ADO supposed to guess that "AANWREG" is a table?

Why arent you specifying CursorLocation, LockType, CursorType and additional
arguments telling ADO what "AANWREG" is?
Open() is the most important call of a Recordset, it affects various
properties, behaviour of methods, it is crazy to allow default arguments. It
also affects performance.

Cheers

Stephen Howe





.