PRB: WillExecute Event Cannot Be Used to Change CursorTypeLast reviewed: September 9, 1997Article ID: Q173463 |
The information in this article applies to:
SYMPTOMSIf the WillExecute event is used to set the CursorType property, the resultset for the cursor may contain nothing if the CursorType has not been set before the WillExecute event fires. Setting a Remote Data Control resultset equal to the query resultset will cause the error:
"runtime error" 40516 Invalid Object" CAUSEThe CursorType property is set but will only affect subsequent queries. The CursorType property is not set for the query that caused the WillExecute event to fire.
RESOLUTIONSet the CursorType and LockType properties before running the query.
STATUSThis behavior is by design.
MORE INFORMATIONThe purpose of the WillExecute event is to allow modifications of a query's SQL or to allow a query to be cancelled. All query properties can be modified here, but changing some properties will not affect the current query that caused the event to fire. CursorType and LockType are two properties that cannot be changed for the current query. Changing other properties, such as SQL and maxrow, will affect the resultset returned by the current query that caused the event to fire.
Steps to Reproduce Behavior
REFERENCESFor information on WillExecute, please see the following: Visual Basic Online Books, and the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q172082 TITLE: HOWTO: Handle WithEvents/RDO 2.0's in Asynchronous Processing(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Margery Simms, Microsoft Corporation Keywords : vb5all kberrmsg Version : WINDOWS:5.0 Platform : WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |