PRB: Records Are Not Added When addRecord and updateRecord Methods Are Used in Same Event (263621)
The information in this article applies to:
- Microsoft Visual InterDev 6.0
This article was previously published under Q263621 SYMPTOMS
If the addRecord() and updateRecord() methods of a Recordset Design-Time Control (DTC) are used in the same event (for example, button_onclick), you may find that the new record is not added or that unexpected results occur.
CAUSE
Both of these methods require a round-trip from the client to the server. However, only one trip to the server can occur from an event. The problem behavior occurs because there is an attempt to make two trips to the server from the same event.
RESOLUTION
There are two ways to work around this problem:
- Use two different events, one for each method. For example, use two buttons (btnAdd and btnSave) and place the addRecord() method in the btnAdd_onclick() event and the updateRecord() method in the btnSave_onclick() event.
- If you need to add a record from within the same event, use the addImmediate() method of Recordset DTC in place of the addRecord() method.
STATUS
This behavior is by design.
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
190768 BUG: Error Calling Some Methods from OnDatasetComplete
190591 BUG: Inserting a New Record With addImmediate May Fail
Modification Type: | Major | Last Reviewed: | 4/21/2001 |
---|
Keywords: | kbCtrl kbprb KB263621 |
---|
|