INSERT IN myView (field1, field2) VALUES (cvalue1, cvalue2) =tableupdate(.t.,.t., 'myview') requery('myview')John,
INSERT IN myView (field1, field2) VALUES (cvalue1, cvalue2) IF tableupdate(.t.,.t., 'myview') * Success requery('myview') ELSE * Update failed, do somehting about it ENDIFSecondly, if the table that your view gets data from is also open and buffered in the same data environment then you need to TableUpdate() that also;
INSERT IN myView (field1, field2) VALUES (cvalue1, cvalue2) IF tableupdate(.t.,.t., 'myview') IF TableUpdate(.t.,.t.,"TheTable") * Success requery('myview') ELSE * The table failed updating ENDIF ELSE * Update failed, do somehting about it ENDIFThirdly, using a forced update as the initial one is a poor desing. You are completely disabling VFP's internal notification of update conflicts. Contrary to what you may think, using a force update does NOT guarantee the update will succeed. it only force the update past an "Update conflict", that is the record having been changed by another user while your view was being worked on. Ther are many things that can cuse an update to fail (broken entwork cable, file server going down, bad NIC board, insufficient rights on teh server, etc.. Using the Force option of TableUpdate() only affects one of those reasons, update conflict.