ACC2000: Data Access Page MSODSC Events Do Not Run By Default (257637)



The information in this article applies to:

  • Microsoft Access 2000

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.
  1. Open a data access page in Design view.
  2. On the Tools menu, point to Macro, and then click Microsoft Script Editor.
  3. 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

  4. Change the Script tag for the Current event of the MSODSC from
    <SCRIPT event=Current for=MSODSC language=vbscript>
    					
    to
    <SCRIPT event=Current(abc) for=MSODSC language=vbscript>
    					
  5. On the File menu, click Save.
  6. On the File menu, click Exit to close the Microsoft Script Editor.
  7. On the View menu, click Page View. Note that the alert appears.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click Design View, and then click OK.
  4. On the Tools menu, point to Macro, and then click Microsoft Script Editor.
  5. 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

  6. Place the following code into the Current event:
    MsgBox "The Current event fired for the MSODSC"
    					
  7. On the File menu, click Save.
  8. On the File menu, click Exit to close the Microsoft Script Editor.
  9. On the View menu, click Page View. Note that the alert does not appear.

Modification Type:MajorLast Reviewed:6/24/2004
Keywords:kbDAP kbDAPScript kbprb KB257637