>How do you find the correct record to update? Does SQL automatically find it by the key value in the SQL string? Please tell me it is so!
>
>DP
No, you have to have a Key field.
update mytable set somefield = somevalue where keyfield = keyvalue
Every table should have a primary key field for this very reason. The best way is to create a surrogate [meaningless] key that is of integer data type. This value is never changed and users certainly can not change it. In VFP, my default value for this field is GetKeyID('tablename', 'fieldname'). The GetKeyID is a stored procedure in my DBC. I have a KOUNTERS table that has 3 fields -- TableName, FieldName, LastID. I pass a field name because I do have tables that have more than 1 field that I use an ID generator for although only 1 of the fields is the Primary Key. I do not have PKs that are composed of 2 or more fields.
Mark McCasland
Midlothian, TX USA