General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Using tableupdate followed by requery to get autoinc val
Hi Everyone:
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).
Thanks,
Paul
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only