Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic Trigger Handling? Some condition are fail to use!
Message
From
09/03/1998 01:30:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Basic Trigger Handling? Some condition are fail to use!
Miscellaneous
Thread ID:
00083299
Message ID:
00083299
Views:
46
I would like to make a set of "k" + OldTableName to
carry all deleted data information.
My trigger will call an extenal kMover.prg and the coding will be:
* kMover.prg Make a copy to 'kTable' before delete record!
* As the original Table can pack at anytime if necessary!

LPARAMETERS oTable, oKey, oKey2
LOCAL kTable, kKey, kKey2

SELECT &oTable
kKey = &oKey

if pcount() = 3
  kKey2 = &oKey2
endif

kTable = "k" + Alltrim(oTable)

use in kTable  && prevent open it already
use &kTable in 0 shared

if pcount() = 3
  Append from oTable for "&oKey" = &kKey and "&oKey2" = &kKey2
else
  Append from oTable for "&oKey" = &kKey
endif

use in kTable
Previously, I have make a version on Recno() but still error on
trigger because the pointer try to move around!!
* Previously passing oTable, oRecno
...
Append from oTable for Recno() = oRecno

Of cos, if possible, add datetime() field to mark when delete and
also if possible, take out the Novell system "USER" Variable
to know who did it it better. GETENV("USER")

But firstly I fail to Move it to another table when triggering!

So, any suggestions to do so instead of above .prg?

Now, I will take a look on avoiding if kTable not exist.
I think this part I can do it! ^_^"
but really I have no idea to copy current record to another table.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Next
Reply
Map
View

Click here to load this message in the networking platform