Scripting a Data Access Page: a Simple Example - Creating a data access page
(Page 2 of 4 )
For a data access page, everything about the page is stored in an HTML file, instead of an mdb file. Let's begin by creating a new data access page. Open the Access program and click on File-->New. In the New File navigation window on the right, click on Blank Data Access Page. Click on New Source... This opens the Select Data Source dialog as shown below. There are a number of sources already present, created for other programs on this machine. Click on the New Source... button.

This opens the Data Connection Wizard with the Welcome screen. Choose Other/advanced by highlighting and clicking on the Next> button.

This opens up the Data Link Properties window with Microsoft Jet 4.0 OLE DB Provider as shown.

Click on the Next> button. In the connection tab, use the ellipsis button and browse to the Northwind database. On this machine it is at: C:Program FilesMicrosoft OfficeOFFICE11 SAMPLES Northwind.mdb You may test the connection and this should say that you succeeded. Accept the default username Admin and you may also place a check mark for the Blank password checkbox as shown. Click OK.

In the screen that pops up as shown in the next picture, you need to select a database and table from the dialog Select Database and Table. However for the mdb file, all that you will be choosing will be the whole database.

Click on the button Next> in the above screen. At this point you will be required to save the data connection and finish the wizard. You need to make suitable entries: give a filename, and add some description and keyword(s) as shown in the next picture. Keywords help if someone wants to search the pages.

Now click on the button Finish. You will finally save this file as an ScriptExple.odc file.

Click on the button labeled Open in the above window now. This opens up the data access page in design view as shown. You are given a hint to add fields by dragging fields from field list as shown.

Go to View in the main menu, and from the drop-down click on FieldList to reveal the tables/fields as shown here.

Highlight Company Name, Contact Name, City and Address holding down the Control key as shown. Drag and drop the group onto the design pane as shown in the next picture. You will be asked to choose a layout style by the Layout Wizard. Accept the default and click OK

Work on your controls by adjusting widths and alignments so that they show clearly, as shown in this picture.

Add a label to the area above the dragged elements as shown. Right click the label, go to the other tab and change its innerText from Label0 to Test as shown.

This changes the label caption on the design page to "Test" as shown in the next picture.

Now click on View-->Page View from the menu item to see how it appears when it is displayed on the web browser.
Next: Adding a script to this page >>
More Microsoft Access Articles
More By Jayaram Krishnaswamy