Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I misusing TableUpdate()?
Message
From
13/09/1999 16:54:14
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00261437
Message ID:
00264209
Views:
49
>>>I changed one field in a visible record and GetFldState says:
>>>34444444444444444443
>>
>>This is the problem. VFP thinks that the record in the view is a newly appended record. Is this record in the view from a REQUERY(), or are you putting it there? Either way, you can fool VFP into thinking that the record is not new by using the SETFLDSTATE() function to change all of the field states to 1 and 2.
>
>The record (all records) are put in there by me, not from requery(). My code is now:
>
> select CustUpdate
> nNothing = SetFldState(0,2,'CustUpdate')
> tableupdate(1,.t.,alias())
>
>And I get error "invalid argument/type/function/yaddayaddayadda". Isn't there a way to force this for the whole record? I tried to put zero and -1 in the first entry to get it to work on the whole table and it wouldn't go. Both VFP docs and the Hacker's Guide CDROM are sparse on this one, so I turn back to you again. :) I just want to blast all changes from my view back into the source table.....

Try this:

lnFieldCount = AFIELDS(laFields)

FOR i = 1 TO lnFieldCount
DO CASE
CASE GETFLDSTATE(i,"Custupdate") = 3
SETFLDSTATE(i,1,"CustUpdate")
CASE GETFLDSTATE(i,"Custupdate") = 4
SETFLDSTATE(i,2,"CustUpdate")
OTHERWISE
* Do nothing
ENDDO
ENDFOR
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform