Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update trigger question
Message
 
 
À
27/02/2001 04:03:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00479925
Message ID:
00480069
Vues:
13
>How can i replace a field with datetime() in the update triger?
>Thanks.

You can not update the value of any field in an update trigger of a VFP table. This like an endless loop.

First edit the Stored Procedures of the DBC. Create a procedure called SetDate --

procedure SetDate
*
lparameter tcField
if vartype(tcField) <> "C" or empty(tcField)
tcField = "LastUpdate"
endif
tcField = upper(alltrim(tcField))
local llFound, i
for i = 1 to fcount()
if upper(field(i)) == tcField
llFound = .t.
exit
endif
endfor
if llFound
replace (tcField) with Date()
endif
return .t.

For the table, put SetDate('LastUpdate') in the Record Validation Rule of the table. Substitute your data field name for LastDate. Now everytime a field is modified in that table the LastUpdate field of the table will be set to the current date.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform