Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which records were actually editted?
Message
From
11/04/2000 12:55:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00358128
Message ID:
00358172
Views:
11
>Hi Cetin,
>>>>
>>>>I have a table in optimistic Table buffered mode. When my form is in EditMode, I can edit records, then I want to save my changes. I issue TableUpdate. My question is: how can I determine, which records were actually updated? I want to replace modidate field with datetime() for these particular records.
>>>>
>>>> Could it be done in Update trigger instead, if this table is a part of database? I rare use triggers, so I'm not sure, how would it be done...
>>>>
>>>> Thanks in advance.
>>>
>>>
Nadya,
>>>Check getnextmodified() and fldstatus().
>>>Cetin
>>
>>
Ooops. Peter's is correct. It's getfldstate() not fldstatus() :)
>>Cetin
>
> I'm currently use GetNextModified(0) to determine, if I made some changes.
> So, the procedure should looks like:
>
>
> lnRecno=0
> do while .t.
>   lnRecno=GetNextModified(lnRecno) && Get Next modified record
>   if lnRecno>0 && this record was modified
>      go lnRecno
>      replace modidate with datetime()
>   else
>      * there are no modified records left
>      exit
>   endif
> enddo
>
> Right? I just create this code, haven't tested yet...


Nadya,
Gee tagged code is hard to strip:)Similar but not quite. getnextmodified() would return negative values for "appended" records.
 lnRecno=GetNextModified(0) && Start to get modified
 do while lnRecno#0
   if lnRecno>0 && this record was modified
      go lnRecno
      replace modidate with datetime()
   else
      * record was appended
      * if not default datetime inserted do it for it too
   endif
   lnRecno=GetNextModified(lnRecno) && Get Next modified record
 enddo
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform