Microsoft KB Archive/234469

= BUG: OnDataSetChanged and OnDataSetComplete Events Do Not Fire Until Recordset Is Accessed =

Article ID: 234469

Article Last Modified on 5/8/2003

-

APPLIES TO


 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01

-



This article was previously published under Q234469



SYMPTOMS
When you use the RDS Data Control to access data on a remote server, the OnDataSetChanged and OnDataSetComplete events may not fire until a method or property of the recordset is accessed. This behavior only occurs the first time the recordset is loaded into the control, and only if the event is named in the script using the ControlName_EventName syntax.



RESOLUTION
To resolve this problem, use inline event declarations or script tags specifying the object and event. To use inline event declarations, include the event name as an attribute of the object tag, and then set it equal to the name of the function you want to use for the event, for example:

  Declare a sub in the script named MyDC_DataSetChanged and insert the code for the event.

Optionally, you can declare the event function in the script tags and specify the object and event name, as follows:

 // code for event here 



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
Insert the following code into a new HTML page:

       <BR>

<SCRIPT LANGUAGE="VBScript"> Sub ADCControl_OnDataSetChanged MsgBox "OnDataSetChanged Event" End Sub

Sub ADCControl_OnDataSetComplete MsgBox "OnReadyState Event" End Sub

Sub RecordCount_OnClick MsgBox "Count of records is " & ADCControl.Recordset.RecordCount End Sub

Sub Refresh_OnClick ADCControl.SQL    = Query.value ADCControl.Connect = Connect.value ADCControl.Server = Server.value ADCControl.ExecuteOption = 1 'synchronous execution

ADCControl.Refresh End Sub

Sub Init Query.value  = "SELECT * FROM Authors" Connect.value = "dsn=pubs;uid=;pwd=;" Server.value = "http://servername" End Sub </SCRIPT> </BODY> </HTML>

Save the page to a Web site, and load the page in Internet Explorer 5.0.

When you load the page into Internet Explorer 5.0, modify the connection string and server values to be valid, and then click Refresh. This loads data into the RDS Data Control. The OnDataSetChanged and OnDataSetComplete events should fire, but do not. Click the RecordCount button, and when you access the RecordCount property of the Data Control, the OnDataSetChanged and OnDataSetComplete events fire. Click Refresh again. The events fire immediately.

Keywords: kbbug kbpending KB234469

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.