About offline data

Note   The hyperlink in this topic goes to the Web. You can switch back to Help at any time.

You don't always have online access to your company databases. However, you often want to take selective data offline (that is, download the data to a computer, such as a laptop or home computer), review and update the data away from your workplace, and then conveniently update and reconcile data changes when you have online access again. Using a combination of Microsoft products, a developer and database administrator can create an application that enables offline data access for users.

Why take data offline?

There are many reasons for working with offline data. Here are two common ones:

System requirements for using offline data

You need the following software to create an use offline data:

Creating and using an offline data application

The general process of creating and using an offline data application works like this:

A developer creates a Web-based database application using one or more data access pages

In a Microsoft Access Project connected to a Microsoft SQL Server 2000 database on the remote server, a developer creates one or more data access pages that access the data the user wants to take offline. A developer needs to set the following Microsoft Office Data Source Component (MSODSC) properties to configure the Page for offline use:

OfflinePublication

OfflineCDF

OfflineType

OfflineSource

For more information on using these MSODSC properties, press F1 in the Page property sheet on the property field.

If the offline application uses two or more Pages, or a Page contains additional images and controls, then a developer needs to create a Channel Definition Format (CDF) file and link the CDF file to the Page using the OfflineCDF property. Internet Explorer reads this CDF file to download all pages and HTML-related files.

The following examples shows a sample CDF file and a LINK element HTML tag added to the Page:

--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>
--HTML tag in data access page
<link rel = ôofflineö href = ôapplicationfilename.cdfö>

For more information on CDF, see the Microsoft Developer Network (MSDN) Web site.

A database administrator defines replication on the remote SQL Server 2000 database

A database administrator uses SQL Server 2000 to define replication on the remote SQL Server 2000 database, and create a single, named merge publication. SQL Server has a Publication Wizard which makes it easy to create a publication. The SQL Server Desktop Engine installed and running on the local computer is defined as the location of the local subscription database.

To handle potential data conflicts when the offline data is brought back online by a user, a database administrator must also define merge replication rules in the named, merge publication. This named publication can reference any database objects.

Caution   It is important to define server filter restrictions in the publication to reduce the potential large amounts of data moved to the client (which, by default, is all data from all tables).

For more information on SQL Server replication, the Publication Wizard, and merge publications, see the SQL Server documentation.

A user takes the data offline

When a user is viewing a Page in Microsoft Internet Explorer or in Page view of Access, and takes the data offline:

A user works with the offline data

A user disconnects the computer from the intranet, and then reads and updates the data on the local computer. While working offline, the connection to the Access project is automatically pointed to the local subscription database instead of the remote server database.

A user brings the offline data back online

A user reconnects a client computer to the corporate intranet and synchronizes the Page or Pages. The Access project is automatically pointed to the remote server database, instead of the local subscription database. SQL Server merges and updates the offline data (including any schema changes) from the local computer to the remote SQL Server database. If necessary, SQL Server automatically resolves data conflicts with data changed while you were offline as defined by the merge publication rules.