Witch block is best to use for folowing purpose :
In a online system (Mariadb)
oRs .......
I want to save the changes to a change log whenever a user changes a field.
My coaches can change ex. the adres of a member, but I want to log that change :
So I want to store in 'changes" ex. Coach, date, olddata, newdata
I can do it when I change xbrowse data from a selection of rows like this :
- Code: Select all Expand view RUN
- function setploeg(oBrw,cPloeg)
local uSavePos := oBrw:BookMark
if msgYesNo(str(LEN(oBRW:aSELECTED),3)+"-> Geselecteerde leden verplaatsen")
FOR I = 1 TO LEN(oBRW:aSELECTED) // obrw:aSELECTED is an array containing recnos marked
oBrw:BookMark := oBrw:aSelected[ i ] // works for dbf, rowset, ado and all
oCn:Insert( "changes", "doorwie, naam, voornaam,oldploeg,newploeg,datum", { setup_naam, oBrw:naam:value, oBrw:voornaam:value, oBrw:p2017:value, cPloeg, date() } )
if cPloeg <> "NIET ACTIEF"
oBrw:p2017:VarPut( cPloeg ) // Works for dbf, rowset, ado and all
endif
if cPloeg = "EXLEDEN"
oBrw:exlid:VarPut( .F. )
endif
if cPloeg = "NIET ACTIEF"
oBrw:exlid:VarPut( .T. )
endif
next
endif
oBrw:BookMark := uSavePos
return NIL
But i'm looking for a way to do it from insite the xbrowse