Just as a form or report has properties, so does a data access page. Many of the properties are similar to those of forms and reports. This section discusses the most important properties.
To modify the properties of a data access page, you must first make sure that you select the page. The easiest way to select the page is to click its title bar. Among the most important properties of a data access page are its data properties. These appear in Figure 26.25, and the most important properties are discussed here.
The ConnectionFile property designates the name of the Office Database Connection (.odc) file or the Microsoft Data Link (.udl) file that connects a data access page to its data source. Using an ODC or UDL file, you can easily modify the source of the data underlying a data access page without having to make changes to the page itself.
To enter the ConnectionFile property, click the ellipsis within the property. The Select Data Source dialog box appears (see Figure 26.26). Here you can select an existing ODC or UDL file, or create a new file.
To create a new file, follow these steps:
Click New Source to create a new ODC file. The Data Connection Wizard launches (see Figure 26.27).
Select Microsoft SQL Server to connect to a SQL Server database, or select Other/Advanced to connect to another type of data. Click Next.
The dialog box that appears varies based upon the type of data you selected in the previous step. If you want the page to connect to data in a Microsoft Access database, select Other/Advanced. The Data Link Properties dialog box, shown in Figure 26.28, appears.
Select Microsoft Jet 4.0 OLEDB Provider and click Next. The wizard prompts you for the database name.
Enter the database name and click Open. Click Test Connection. Click OK after the connection succeeds, and OK again to close the Data Link Properties dialog box. The wizard shows you the tables and queries located in the selected database (see Figure 26.29). Click Next.
Enter a name and an optional file description for the ODC file (see Figure 26.30). Click Finish.
Select the newly created ODC file in the Select Data Source dialog box. The name and location of the ODC file is entered into the ConnectionFile property.
The ConnectionString property sets an ActiveX Data Objects (ADO) connection string to be used to connect to a database. The string contains all information required to connect to the data source underlying the page.
Another important property is the DataEntry property. By default, the DataEntry property is False. This means that, when the data access page is viewed from within Microsoft Access or within a browser, all records in the underlying data source are available. When changed to True, records can be added, but existing data cannot be seen (see Figure 26.31).
The MaxRecords property allows you to designate the number of records that a connection sends to the local computer. If you do not set this property properly, extremely large volumes of data can travel over the Internet or over an intranet to the user's browser. This can cause severe performance problems. It is therefore a good idea to set this number to the maximum number of records that you feel are appropriate for a user to retrieve.
You can set the RecordsetType property to dscUpdatableSnapshot or to dscSnapshot. With dscUpdatableSnapshot the data in the resulting data access page can be edited. If you select dscSnapshot, the data is rendered view-only.
The UseRemoteProvider property determines whether the data source control uses the Microsoft Remote Data Services provider for data connections. This property can be set to True only for pages that are read from a Microsoft Internet Information Server (IIS) using an HTTP or HTTPS (secure) address. When used, the Microsoft Remote Data Services provider fetches data by passing the HTTP or HTTPS request to Microsoft IIS. IIS makes the OLE DB connection to the database.