Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to call the parent class in VFP?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00024551
Message ID:
00026509
Views:
53
>>-- snip --
>Sorry I didn't reply sooner. I thought for a while about your answer. My cmdadd uses an APPEND rather than an INSERT, because that's how the wizard did it. I seem to remember that there was a thread explaining why INSERT is better, but I can't remember what its reason was. My required fields have no default values, so I don't want to save a record with the wrong values filled in. The table that I was given has no primary key. I am getting them to add stuff so that unique keys can be generated, but for the moment it has to work without them. Are you saying you copy your primary key values to another table?

First, I use INSERT rather than APPEND BLANK because I DO have unique IDs and this way there is never a moment when there is a record with an empty ID field. INSERT adds data to fields while it appends the record.

Second, I use a table with a record for each of my data tables. Each record holds the table name, ID field name and matching index (usually the same name) and a field containing the last ID value used. When I need to insert a record, I lock the appropriate record in the ID table, increment the numeric field, check for duplicates and unlock the ID record. Then I'm ready to do an INSERT in the original table. All my IDs start with numbers turned into strings (pad the left characters with '0'), but some apps use a 3-char suffix to show where in multiple installations a record originated.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform