Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapters: How to set Default value and RuleExpress
Message
 
 
À
04/01/2004 06:51:05
Jean-Pierre Overbeek
New Limit Database Solutions
Amsterdam, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00863700
Message ID:
00863856
Vues:
17
>Hi,
>
>Is it possible to use default values and RuleExpressions in CursorAdapters?
>
>We would like to move our updateable views (with default values and code in RuleExpression) to cursor adapters. For the views we set all kinds of default values for fields:
>
>cStatus c(1) default 'I' RuleExpression 'FillStatusUpdate()',
>tStatusUpdate t
>
>function FillStatusUpdate
>replace tStatusUpdate with datetime()
>return .t.
>
>Appending a record to the view based cursor fills the cStatus field with 'I'.
>Updating the cStatus field fires the FillStatusUpdate() function.
>BUT this doesn't work in CursorAdapter based cursors!!!
>
>Please help,
>TIA
>
>Greetings,

Jean-Pierre,
Just a thought, but you could try opening the cursor with no data. Then issue a CursorRefresh to actually fill it. In the BeforeCursorRefresh event, you could add a couple of ALTER TABLE commands to modify the open table.

This may not work because Rules and DefaultValues are stored in the DBC. Cursors generated by CursorAdapters are not.

Why can't you point your CA to the view or table with the default expression set in the DBC. When you send the updates back, the fields will be populated. You can then refresh the CA to display those values.

Regards.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform