Microsoft KB Archive/257637

= ACC2000: Data Access Page MSODSC Events Do Not Run By Default =

Article ID: 257637

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q257637



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you place script in any of the events of the Microsoft Office Data Source Control (MSODSC), and you leave the arguments of the events at their default values, the script in the events does not run.



CAUSE
The default language that is set for all data access page events is VBScript, and the parameter in the EVENT argument is missing. Until you supply a parameter to this argument, the event does not run. When the language variable is set to JSCRIPT, the MSODSC events do run because then a parameter is not required.



RESOLUTION
Add an argument to the event of the MSODSC. It does not matter what you add as the argument, as long as you add one. The following example shows you how to add an argument to the Current event; however, all of the events of the MSODSC that you add script to need an argument.  Open a data access page in Design view. On the Tools menu, point to Macro, and then click Microsoft Script Editor. By default, the Script Editor tool appears in the first of the three panes in the Microsoft Script Editor. This pane also contains the HTML Outline and Toolbox tabs. Click the Script Editor tab, and then browse through the tree to the event that you want to add an argument to. For example, select the following path to add an argument to the Current event:

Client Object and Events\MSODSC\Current

  Change the Script tag for the Current event of the MSODSC from  to   On the File menu, click Save.</li> On the File menu, click Exit to close the Microsoft Script Editor.</li> On the View menu, click Page View. Note that the alert appears.</li></ol>

<div class="moreinformation_section">

Steps to Reproduce the Behavior
<ol> Open the sample database Northwind.mdb.</li> In the Database window, click Pages under Objects, and then click New.</li> In the New Data Access Page dialog box, click Design View, and then click OK.</li> On the Tools menu, point to Macro, and then click Microsoft Script Editor.</li> By default, the Script Editor tool appears in the first of the three panes in the Microsoft Script Editor. Browse through the tree to the following path:

Client Object and Events\MSODSC\Current

</li>  Place the following code into the Current event: MsgBox "The Current event fired for the MSODSC" </li> On the File menu, click Save.</li> On the File menu, click Exit to close the Microsoft Script Editor.</li> On the View menu, click Page View. Note that the alert does not appear.</li></ol>

Additional query words: prb

Keywords: kbdap kbprb kbdapscript KB257637

-

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

© Microsoft Corporation. All rights reserved.