Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HELP! Can't Update the source table with a view
Message
From
10/01/1999 17:32:16
 
 
To
09/01/1999 21:22:37
Jack Lee
Wheel Giant Inc.
Changhua, Taiwan
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00172712
Message ID:
00174530
Views:
44
>Hi Erik.
>
>After read Nancy¡¦s advice, I ask myself:
>¡§Why I need to open the Source Table and View at the same time?¡¨
>The only one reason is Primary-Key. VFP doesn¡¦t maintain PK field automatically like SQL server. I need to do this by myself. I run a routine instead of SQL-Select because it takes a long time in network, To get the max value of the PK field and replace it with new value. In my routine, I USE the table and SET INDEX of it.
>
>Would you give me an advice?
>Thanks!
>
>Jack Lee

The common way to handle PKs in VFP is with a table that contains the next available primary key for each table in your database. Then, the default value for the primary key field in your data table is a call to a function that looks up the next primary key, increments the value and returns the PK. There is a pretty good example of this in the Tastrade sample app that ships with VFP. Look in the stored procedures of the tastrade.dbc. Lt me know if you have any questions on this method, this is pretty close to "the way its done".
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform