local llRemote, lcSQL, lcTable, ldDate
ldDate = date()-lnDays
llRemote = cursorgetprop(“SourceType”,”V_LoginHistoryOneUser”)=2
IF llRemote
lcTable = x3vtable(“V_LoginHistoryOneUser.ULH_PK”)
lcSQL = “SELECT ULH_PK ” + ;
“FROM ” + lcTable + space(1) + ;
“WHERE ULH_Out < ?ldDate OR ULH_In 0
IF reccount(“AutoPurge”) > 0
select AutoPurge
*
* turn the AutoPurge SPT cursor into an
* updateable view
*
cursorsetprop(“Buffering”,5)
cursorsetprop(“SendUpdates”,.t.)
cursorsetprop(“Keyfieldlist”,”ULH_PK”)
cursorsetprop(“Tables”,lcTable)
cursorsetprop(“UpdateNameList”,”ULH_PK ” + lcTable+”.ULH_PK”)
cursorsetprop(“UpdatableFieldList”,”ULH_PK”)
*
* delete ‘em all
*
delete all
*
* we don’t care about the RETURN value from
* tableupdate() because if they don’t get
* deleted this time, no big deal
*
tableupdate(.t.,.t.,”AutoPurge”)
use in AutoPurge
ENDIF
ENDIF
Posted by: nowiremember | January 6, 2010
Visual Poxpro: Create a SPT and make it updatable
Advertisement
Posted in Uncategorized