Hi;
does any one knows if tere is a way to know which field is the primary key in a table?
i have a rutine that logs changes on a table at field level, but i need to log the record's primary key as well.
TIA
looking for primary key field
You can use the DESCRIBE table_name command to get such information about a table.
You can determine key fields in a dataset by MyDAC means in the following way:
You can determine key fields in a dataset by MyDAC means in the following way:
Code: Select all
var
i: integer;
begin
MyQuery1.Open;
for i := 0 to MyQuery1.FieldCount - 1 do
if MyQuery1.GetFieldDesc(MyQuery1.Fields[i].FieldName).IsKey then
ShowMessage(MyQuery1.Fields[i].FieldName + ' is in key');