How To Use Offline Views in Visual FoxPro

Last reviewed: January 20, 1997
Article ID: Q156552
The information in this article applies to:
  • Microsoft Visual FoxPro 5.0 for Windows

SUMMARY

With the introduction of Offline Views, Visual FoxPro has brought together tables and views in a different way. This article explains these differences and new functionality.

MORE INFORMATION

Offline views are actually a table and view depending on which clause you use with the USE command (USE, USE ADMIN, or USE ONLINE).

When you create an offline view with the CREATEOFFLINE command, it is possible to have five new files that belong to the offline view (not counting the database's .dbc file).

Example 1

The table that the view is built from does not contain a MEMO or GENERAL field:

   CREATEOFFLINE('view1')

The view1.dbf, view1.tbf, and view1.tdx files are created.

Example 2

The table that the view is built from does contain a MEMO or GENERAL field:

   CREATEOFFLINE('view1')

The view1.dbf, view1.tbf, view1.tdx, view1.tpt, and view1.fpt files are created.

The USE command by itself with the offline view actually uses a table(for example, view1.dbf) that was created from the CREATEOFFLINE command. Even though users are using a table, they can only set the BUFFERING mode to OPTIMISTIC ROW or OPTIMISTIC TABLE buffering. In this mode the users are also allowed to place a INDEX on the offline view. Once the offline view is used ONLINE or in ADMIN mode, the index is dropped and a new one has to be created the next time the users use the offline view with the USE command.

When the users use the ADMIN or ONLINE clause with the USE command, they are now using a view. While using the offline view with either of these two clauses, the users are not allowed to change the BUFFERING mode or to place a INDEX on the offline view. The ADMIN clause does not try to reestablish a link back to the server, while the ONLINE clause does.

Offline views are allowed to have Relations (SET RELATION TO), but they cannot be used with referential integrity. Other commands that cannot be used with offline views are PACK, ZAP, MODIFY, and REQUERY.

If you are taking the offline view away from the database, you should copy all the files mentioned above along with the database's .dbc file.


KBCategory: kbusage kbprg kbhowto
KBSubcategory: FxprgTable
Additional reference words: 5.00 kbdse vFoxWin buffering admin
createoffline



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.