Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto generated primary keys
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00538153
Message ID:
00538161
Views:
19
This message has been marked as the solution to the initial question of the thread.
>I use auto generated primary interger keys for many tables in my application's database. The "new" functionality on the supporting bizobj maintenance forms seem to work quite well. However, I noticed that for each record added an iId value is skipped, which is a rather strange behavior, I thought worthy of investigation.
>
>I'm using 6.1 to develope my app.
>
>I found that the database's newid() stored procedure is called when the new command button is clicked and when the ov_table.save() does its tableupdate().
>
>I compared my new records with those added in the 6.1 projmgr sample tables. I found that for those tables the newid() is called only on the new command button click and not when the tableupdate() is done, thus no ids are lost or wasted (unless the add is canceled).
>
>I've compared my forms, views, data environments, and cursors properties with those of the sample app and I can't come up with any differences that would account for the strange behavior.
>
>Does anyone have an idea what's going on? Most specifically, what causes the tableupdate() to call (or not call) newid() ?
>
>TIA

I had the similar problem recently and had a thread here about it. It dependas on how you set up your view and do you or do not make the Key Field Updatable. I'll try to find the thread number for you.

It's probably this one Forum: Visual FoxPro Category: Databases,Tables, Views, Indexing and SQL syntax Title: Re: Correct way to call DBC stored procedure Thread #523854 Message #524309, though I had few similar threads at the same time.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform