Creating Web-Based Applications for Offline Data AccessThis content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Microsoft® Access 2002
Summary: Describes how to configure a Microsoft Access 2002 data access page for offline use. (3 printed pages)
Microsoft® Access 2002 allows offline access to server data. This enables users to review and update data while they're away from the network, and synchronize local and server data at a later date.
NoteThis article focuses specifically on the basic developer requirements for implementing an offline data solution. For a general overview of all the necessary steps to allow offline data access, including database administrator and end-user requirements, see "About offline data" in Microsoft Access Help.
Enabling offline data requires the following software:
- Microsoft Access 2002 installed on a client computer, such as a laptop or home computer
- Microsoft® SQL Server™ 2000 Desktop Engine installed and running on a client computer
- Microsoft SQL Server 2000 installed and running on a remote server
- Microsoft® Internet Explorer 5.0 or later installed on the client computer and remote server
In a Microsoft Access Project connected to a Microsoft SQL Server 2000 database on the remote server, you must create one or more data access pages that access the data the user wants to take offline. The following Microsoft Office Data Source Component (MSODSC) properties must be set via the Page property sheet during design-time to configure the page for offline use.
OfflineType is the type of connection used to persist the data when a data access page is taken offline. The default value is dscOfflineXMLDataFile. Set the property to dscOfflineMerge to store data in a local SQL Server 2000 Desktop Engine database or to dscOfflineXMLDataFile to store data in an XML file. The dscOfflineMerge property is only available in Access projects.
OfflineSource is the data source used when the page is offline. The default value is "pagename_Data.xml" where pagename is the name of the current page.
The value to use for this property depends upon the current setting of the OfflineType and XMLLocation properties.
- If the OfflineType property is set to dscOfflineMerge, this property should be set to a connection string for the local SQL Server 2000 Desktop Engine database.
- If the OfflineType property is set to dscOfflineXMLDataFile and the XMLLocation property is set to dscXMLDataFile, then this property should be set to a string containing the path to the XML data file. This can be a local path, a relative path, or a URL.
- If the OfflineType property is set to dscOfflineXMLDataFile and the XMLLocation property is set to dscXMLDataEmbedded, then this property should be set to the ID of the XML data island inside the page. This ID can be retrieved from the XMLDataTarget property.
OfflinePublication is the name of the merge publication on the server to use when taking the page offline. On the Page property sheet, this will be a drop-down list of all available merge publications on the remote server.
This property is only valid if the OfflineType property is set to dscOfflineMerge.
OfflineCDF is the name of the Channel Definition Format (CDF) file to which the data access page is to be linked. See below to learn how to access more information about CDF files.
If the offline application uses two or more data access pages, or a data access page contains additional images and controls, then the developer needs to create a CDF file and link it to the page using the OfflineCDF property. Internet Explorer reads this CDF file to download all pages and HTML-related files.
The following examples show a sample CDF file and a <LINK> element HTML tag added to the data access page:
Example 1. Contents of a CDF called "applicationfilename.cdf"
<?XML VERSION="1.0" ENCODING="windows-1252"?> <CHANNEL HREF="default.htm" PRECACHE="YES" LEVEL="0"> <ITEM HREF="Products.htm"></ITEM> <ITEM HREF="Categories.htm"></ITEM> <ITEM HREF="CategoryDetail.htm"></ITEM> <ITEM HREF="Orders.htm"></ITEM> <ITEM HREF="OrderDetails.htm"></ITEM> <ITEM HREF="xmldata\Categories.XML"></ITEM> <ITEM HREF="bitmaps\CorpLogo.gif"></ITEM> <ITEM HREF="bitmaps\ShippedItem.gif"></ITEM> <ITEM HREF="bitmaps\BackorderedItem.gif"></ITEM> <ITEM HREF="bitmaps\Discontinued.gif"></ITEM> </CHANNEL>
Example 2. HTML tag required in the data access page
<link rel=“offline” href=“applicationfilename.cdf”>
For more information, run a search query on CDF in the Microsoft Developer Network (MSDN) Online Library.