BUG: Error Calling Some Methods from OnDatasetComplete

ID: Q190768


The information in this article applies to:


SYMPTOMS

When calling certain recordset methods from the ondatasetcomplete event handler for that recordset, a run-time error message will appear that states, "RDS has made an event call back to the consumer and has not yet returned."


CAUSE

Certain methods that may alter the data in a recordset are not allowed from the ondatasetcomplete event handler.


RESOLUTION

Do not attempt to make changes to the recordset until the event handler has returned. One way to delay making changes is with the setTimeout method of the window object, for example:


   window.setTimeout("myRS.addImmediate(fields, values)", 10) 


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

Methods that are not allowed in an ondatasetcomplete event handler because they change the recordset are: addImmediate, addRecord, deleteRecord, requery, updateRecord.

Steps to Reproduce Behavior

  1. Open a new HTML page from a Web project with a data connection.


  2. In Source view, drag a RecordsetDTC from the Toolbox onto the page.


  3. Double-click the "Client Objects & events\Recordset1\ondatatasetcomplete" node of the Script Outline window to create the event handler routine.


  4. In the event handler, call the 'Recordset1.addImmediate()' method, passing it the appropriate parameters.


  5. Save the page, then browse it in Internet Explorer.


Additional query words:


Keywords          : kbADO kbVisID600bug kbGrpASP 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 24, 1999