Microsoft KB Archive/192151

= BUG: Client-Side Events Do Not Execute in VBScript =

Article ID: 192151

Article Last Modified on 8/27/2007

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q192151



SYMPTOMS
When using Design-Time Controls (DTCs) that ship with Visual InterDev 6.0, the client-side events will not execute if they are being called using VBScript and the client (that is, browser) JScript.dll is version 3.x.



CAUSE
The DTCs that ship with Visual InterDev 6.0 require the client machine to have the JScript.dll version 4.0 or later when using VBScript to handle the DTC events. This is caused by the DTCs underlying use of the Script Object Library that ships with Visual InterDev 6.0.



RESOLUTION
There are several workarounds:   Use the advise method to associate your VBScript function with the event. The following example associates the VBScript procedure Recordset1_ondatasetcomplete with the "ondatasetcomplete" event of the Recordset1 object.

 Recordset1.advise("ondatasetcomplete", Recordset1_ondatasetcomplete); 



Sub Recordset1_ondatasetcomplete '-- Event Handler Code -- End Sub    Call the VBScript procedure with a JScript event. The Event Handler "wrapped" in JScript would look like:



Sub Recordset1_ondatasetcomplete_VBS '-- Event Handler Code -- End Sub 

 function Recordset1_ondatasetcomplete { Recordset1_ondatasetcomplete_VBS }    </li> The event handler could also be rewritten entirely in JScript, which will work even if the client is running version 3.x of the JScript.DLL.</li></ul>

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

<div class="references_section">