To retrieve the
RecordSource property of a data access page:
- Open the sample database Northwind.mdb.
- In the Database window, click Pages under Objects, right-click the Analyze Sales page, and then click Design View.
- On the Tools menu, point to Macro, and then click Microsoft Script Editor.
- On the View menu, point to Other Windows, and then click Script Outline. This places the focus in the Script Outline window pane, at the top-most node that is labeled Client Objects & Events.
- Expand this node (if it is not already expanded), and browse to the MSODSC node.
- Expand the MSODCS node, and then double-click Current.
- Place the following line of script in the Current event:
MsgBox MSODSC.DefaultRecordset.Source
- On the File menu, click Save, and then on the File menu, click Exit.
- On the View menu, click Page View. Note that when the page is displayed, you receive a message box that contains the complete RecordSource value for the data access page.
IMPORTANT: When you create VBScript blocks for MSODSC events, you must add a parameter to the event name as follows:
<SCRIPT LANGUAGE=vbscript FOR=MSODSC EVENT=Current(oEventInfo)>
The <I>oEventInfo</I> parameter returns specific information about the event to the script. You must add this parameter, whether or not it will be used, because the script will not work without it.