General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Auditing deleted records
I have a class which audits everything. For now I it audits row and tables buffering: Insert and Modifications:
Lparameters cAlias,tHora
Local lcChanges,lnCampo,lcFieldName
lcChanges="Tabla: "+Proper(cAlias)+Chr(13)+Chr(10)
For lnCampo= 1 To Fcount(cAlias)
lcFieldName = Field(lnCampo,cAlias)
Do Case
Case Getfldstate(Field(lnCampo,cAlias),cAlias) = 2 &&mod
lcChanges = lcChanges+"Modification: "+;
Transform(Oldval(lcFieldName,cAlias))+" changed to: "+ lcFieldName + ": "+;
Transform(Eval(cAlias+"."+lcFieldName))+Chr(13)+Chr(10)
Insert Into clogging (usuario, feyho, cambios) Values ;
(_Screen.UsrName,tHora,lcChanges)
Case Getfldstate(Field(lnCampo,cAlias),cAlias) = 4 &&insert
lcChanges = lcChanges+"Inserted: "+lcFieldName+": "+;
Transform(Eval(cAlias+"."+lcFieldName))+Chr(13)+Chr(10)
Insert Into clogging (usuario, feyho, cambios) Values ;
(_Screen.UsrName,tHora,lcChanges)
Endcase
Next lnCampo
I want to control deleted records, should I do a simple DELETED() function call?
Thanks in advacne,
Pablo Velazco
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only