unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ADODB, DB, DBTables, StdCtrls;type TForm1 = class(TForm) btn1: TButton; con1: TADOConnection; procedure btn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementationuses ADOInt;{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);const COLUMN_NAME = 'COLUMN_NAME'; TABLE_NAME = 'Test';var Fields: Recordset;begin try if not con1.Connected then begin con1.Open; end; Fields := con1.ConnectionObject.OpenSchema(adSchemaPrimaryKeys, VarArrayOf([Null, Null, TABLE_NAME]), EmptyParam); while not Fields.EOF do begin ShowMessage('PrimaryKey:' + VarToStr(Fields.Fields[COLUMN_NAME].Value)); Fields.MoveNext; end; finally con1.Close; end;end;end.