BeforeCursorAttach Event

Occurs immediately before the CursorAdapter object attempts to attach a cursor. You can use this event to perform any necessary operations before attaching the cursor or table, determine an alias to attach, and so on.

PROCEDURE Object.BeforeCursorAttach 
LPARAMETERS cAlias

Parameters

  • cAlias
    Specifies the alias of the cursor or table being attached.

Remarks

Applies To: CursorAdapter Class

If the code in BeforeCursorAttach returns a value of False (.F.), the cursor attachment does not occur.

Note

The CursorAdapter object respects any changes that might be made to the cAlias parameter by BeforeCursorAttach.

Example

The following example illustrates how to open a local view in BeforeCursorAttach so that you can attach the view to a CursorAdapter object:

PROCEDURE BeforeCursorAttach
OPEN DATABASE HOME(2)+"tastrade\data\tastrade.dbc"
USE 'product listing'
ENDPROC

Then make the following call to attach the view:

CursorAttach('product listing', .T.)

See Also

Reference

CursorAdapter Object Properties, Methods, and Events
AfterCursorAttach Event
CursorAttach Method

Other Resources

Events (Visual FoxPro)