Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incomplete TABLEUPDATE()
Message
From
03/06/2004 12:07:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/06/2004 11:58:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00909598
Message ID:
00909601
Views:
6
>Greetings!
>
>I have a table with four fields. One of them is a logical field named "Assigned". I created some records in the table, but I did not set the "Assigned" value for any of them.
>
>I then ran the following program:
>
>USE te_assigned_products IN 0 ALIAS edit_products
>cursorsetprop("Buffering", 5)
>UPDATE edit_products SET Assigned = .f.
>TABLEUPDATE(0, .f., "edit_products")
>
>I expected that this would set the Assigned field for all records in the table to .f. Instead, it only set the Assigned field for the last record! All the other records still had .null. for the Assigned field.
>
>Why is this?
>
>I'm thinking this may be related to the "Browse and query don't match" problem I started another thread for.
>
>Thanks again!

The first parameter, 0, indicates that only changes to the current record will be saved - not to all records.

Also, you should always check the return value of TableUpdate(), for example:

if not TableUpdate(...)
aerror(laErrorInfo)
MessageBox("Can't update record(s). Error number: " + trans(laErrorInfo(1));
+ " Error message: " + laErrorInfo(2))
endif
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform