Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning code after sucessful insert
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00450463
Message ID:
00450469
Views:
35
>Is there a way to determine if an insert in vfp table was successfull or not? Does an successful insert (or not successful) generate a code? Help appreciated
>
>Nick Patel

If it doesn't throw one of the File in Use errors, it is safe to say it worked. The reason I say this is INSERT INTO locks the table header, appends a record and changes the header to reflect the new table information. It then unlocks the header. If it can perform the lock on the file, it can insert the record.

Having said that, there is the off-the-wall error condition that Doug Hennig has posted. If you have a corrupt table header, inserts will look like they worked and tableupdates will return .T. but the table will not be updated. Yo can do a search on his messages and tableupdate to find the exact fix for that condition.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform