General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Ken,
I have used this same methodology for my tables and use views for adds and updates of records. I have the default ID generated using a procedure which looks into a ID table that has a row for each table that needs an ID number. The table has a column that holds the last number assigned and increments it when adding a new record. (I did all this before auto-increment was available in VFP).
The default value I use is defined in the table and not the view and I have never had a problem with this. I can't comment on why your default value property disappears randomly. Do you re-generate view definitions for any reason when making changes to your database? If so, this might be where the default value property gets cleared out.
Bob
>Hi Bob,
>
>Thanks for the reply. Yes, I also check the update criteria for the UID field in the view also (learned that quickly the hard way).
>
>But the issue here is the default value property of the UID field. It seems to randomly disappear from the view definition so for new records in the view doesn't get a UID. This of course affects future modification/updates to the record and can also cause primary key conflicts (two UIDs with value = '').
>
>The reason I do it this way it to always have the UID available immediately after creating a record. If I put the UDF in the table (or use autoincrement) then I have to requery the view and determine which was the new record to get access to the new UID.
>
>How do others do it?
>
>Ken
>
>
Previous
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