JavaScript Editor js editor     Web development 



Main Page

This class is used to manage data sessions and handle data updates in all forms or formsets in the current data session. It enables an Application object to easily iterate through sessions to provide Windows-closing behavior during Exit or Shutdown. It also provides generic QueryUnload behavior for forms and formsets, and generic session-wide Update and Revert code. You can use it to evaluate whether any data has been changed in a session before you use your own conflict handling procedure.

Category Application

Default Catalog

VisualВ FoxProВ Catalog\FoundationВ Classes\Application

Class

_datassession

Base Class

Custom

Class Library

_app.vcx

Parent Class

_custom

Sample

...\Samples\Solution\Ffc\environ.scx

Remarks

This class works with free tables as well as tables in databases. Observe the transactions limit (5).

To use, drop the class on a project or form or, from the Component Gallery Item shortcut menu, select Add to Project or Add to Form. When you add the class to a form, Visual FoxPro places the class on the form. You can then specify the appropriate property values and provide any necessary input and output objects. When you drop the class on a project, you can choose between adding the class or creating a subclass.

See Guidelines for Using Visual FoxPro Foundation Classes for more information on using foundation classes.

Properties, Events, Methods Description

iDataChangedMode property

Specifies the type of data change performed.

Default: 0

iSavedSessionID property

Specifies integer value representing the ID of the saved session.

Default: 1

lSuccess property

Specifies whether the data operation (update) was successful.

Default: .T.

lUseTransactions property

Specifies whether to wrap the updating routine in a transaction.

Note:
Only tables in a database container (.dbc) are affected in transactions.

Default: .T.

DataChanged method

Checks if data has changed.

Syntax: DataChanged(В )

Return: none

Arguments: none

DataFlush method

Ensures that the active control will have its current contents "recognized" even if you choose to update from a toolbar button while a grid has the focus.

Syntax: DataFlush(В )

Return: none

Arguments: none

GetActiveControlRef method

Returns the truly active control, loRealActiveControl, in cases where the current active control is a Grid.

Syntax: GetActiveControlRef(toActiveControl)

Return:В loRealActiveControl

Arguments: toActiveControl specifies the current control.

GetMessageBoxTitle method

Returns a portion of the titlebar text specifying the name of the message.

Syntax: GetMessageBoxTitle(В )

Return:В cTitlebarText

Arguments: none

QueryUnload method

Provides dialog boxes to manage data change decisions.

Syntax: QueryUnload(tlDataChangeAlreadyConfirmed, toForm, tlNoShow)

Return:В liResult

Arguments: tlDataChangeAlreadyConfirmed specifies whether data has been changed. toForm specifies the form.tlNoShow specifies whether to display the form.liResult specifies the MESSAGEBOX or value.

RestoreSessionID method

Restores the data session.

Syntax: RestoreSessionID

Return: none

Arguments: none

Revert method

Reverts the session to original data.

Syntax: Revert(tlUserChoiceAlreadyConfirmed, tlDataChangeAlreadyConfirmed, toForm, tlNoShow)

Return: none

Arguments: tlUserChoiceAlreadyConfirmed specifies whether to display a confirmation dialog box.tlDataChangeAlreadyConfirmed specifies whether to display a confirmation dialog box.toForm specifies the form.tlNoShow specifies whether to display the form.

SetSessionID method

Sets the data session.

Syntax: SetSessionID(В )

Return: none

Arguments: none

Update method

Updates data.

Syntax: Update(tlUserChoiceAlreadyConfirmed, tlDataChangeAlreadyConfirmed, toForm, tlNoShow)

Return: none

Arguments: tlUserChoiceAlreadyConfirmed specifies whether to display a confirmation dialog box.tlDataChangeAlreadyConfirmed specifies whether to display a confirmation dialog box.toForm specifies the form.tlNoShow specifies whether to display the form.

See Also



JavaScript Editor js editor     Web development