Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using tableupdate followed by requery to get autoinc val
Message
 
 
To
11/06/2006 10:42:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Network:
SAMBA Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01128323
Message ID:
01128380
Views:
20
There's no other way to retrieve AUTOINC values in VFP8. The requery() shouldn't be a problem as long as your view returns small number of records.

>I was having some problems dealing with auto-inc values in my tables when they were being updated by views. the views would send any updates using tableupdate, but if i then went to make a change in the view and commit that change back to the table, i would get update conflicts. i noticed that the key field in the view (id) obviously didn't get an autoinc value until after the table reupdated the view, which wasn't happening until i would close the files. i would end up with a key value of 0, and if i had more than one key value with 0, i ended up with problems.
>
>I did a bit of searching and found the requery() function. i placed that after tableupdate, and everything works fine. However, the site's article that listed this did so saying it really is a workaround and it sounded like it should be avoided.
>
>my question is - is there a downside to doing this (ie tableupdate, and then requery the view in order to get the auto inc value for the record)? i'm assuming speed may be an issue but to me it doesn't seem slow (i have less than 50000 records).
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform