Posted by: nowiremember | January 6, 2010

Visual Poxpro: Create a SPT and make it updatable

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

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: