Creating Offline Views
As with online data, analyze your requirements before creating offline views to determine the design of the views you will need in the offline database. Once you know the subset of data you want to use offline, you can start with an existing view or create a new view. If a view already exists that returns the records you want to use offline, you can use it, or you can create one programmatically. The view you take offline is stored in a .dbf file in the offline database container.
Note If you plan to modify data in an offline view, be sure to make the view updateable before you take it offline. Once a view is offline, you can only set its update properties programmatically; you cannot modify an offline view in the View Designer.
To use an existing view offline
- Use the CREATEOFFLINE( ) function and the name of the view.
For example, if you want to go to client sites to update accounts, add customers, and record new sales, you need the customer information as well as current orders and the online product descriptions. You might have a view called customerinfo
that combines information from the Customers table, Orders table, and OrderItems table. To create the view, use this code:
CREATEOFFLINE("customerinfo")
To programmatically create a view offline
- Use the CREATE SQL VIEW command, followed by the CREATEOFFLINE( ) command.
For example, the following code creates a view that displays data from the Products
table and the Inventory
table from the online database. Since no update criteria are specified, this view is read-only:
CREATE SQL VIEW showproducts ;
CONNECTION dsource ;
AS SELECT * FROM Products INNER JOIN Inventory ;
ON Products.ProductID = Inventory.ProductID ;
CREATEOFFLINE("showproducts")
See Also
Manipulating Offline Data | Creating Queries | Updating to Online Data | Optimization of View Performance