Hi,
I need to migrate the following code to SDAC equivalent. Unfortunately, I read that SDAC does not support IndexDefs. Is there a way to achieve the following in SDAC?
wwTable1.IndexDefs.Update;
wwTable1.FieldDefs.Update;
for I := 0 to wwTable1.IndexDefs.Count - 1 do
begin
if wwTable1.IndexDefs.Items.Fields = 'Field1' then
begin
......
end;
end;
Thank you
BDE to SDAC - IndexDefs equivalent?
-
AndreyZ
Hello,
You can use the TMSMetadata component in the following way:Note that MSMetadata returns indexes on more that one field in several records. You can see all fields available in the TMSMetaData component. For this, you should link it to the TDataSource and TDBGrid components. For more information, please read the SDAC documentation.
You can use the TMSMetadata component in the following way:
Code: Select all
MSMetadata.ObjectType := otIndexes;
MSMetadata.DatabaseName := 'database_name';
MSMetadata.TableName := 'table_name';
MSMetadata.Open;
while not MSMetadata.Eof do begin
if MSMetadata.FieldByName('COLUMN_NAME').AsString = 'column_name' then begin
//
end;
MSMetadata.Next;
end;