Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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).

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Keywords: KB257637, kbdapscript, kbprb, kbdap

↑ Back to the top

Article Info
Article ID : 257637
Revision : 2
Created on : 6/24/2004
Published on : 6/24/2004
Exists online : False
Views : 246