Offline Views

Offline Views

10.      Offline Views

Offline Views allow a remote view to be created as a local cursor in the usual way and the server connection to be severed and reconnected at a later time.

Offline views are useful for creating local copies of non-volatile data which can record changes for updating onto the server at a later date. Offline views are particularly useful for distributing data onto remote computers. A salesman can take data away on a laptop and update any changes back onto the server on their return.

The CREATEOFFLINE syntax is used to create the Offline view. The command simply defines a view in the currently open database container and a filename for the local cursor:

OPEN DATABASE dbcpubs

? CREATEOFFLINE( 'vueauthor','c:\temp\authors')

Once created the Offline view can be used with the ADMIN keyword of the use command which will refer to the local copy of the data and not require access to the server:

SET MULTILOCKS ON

USE c:\temp\authors ADMIN

The connection to the server can be re-established using the ONLINE keyword of the USE command. The changes can now be updated onto the server using the standard data buffering techniques:

USE c:\temp\authors ADMIN

IF NOT TABLEUPDATE( .T. )

   * Errors updating offline view

   …

ENDIF

The Offline View may be dropped without updating the server with the DROPOFFLINE command:

DROPOFFLINE( 'vueauthor' ).

 

19/09/2017 21:45:41