不行就用这句SQL来取吧
SELECT b.name 表名, c.name 字段名
FROM sysindexkeys a INNER JOIN
sysobjects b ON a.id = b.id INNER JOIN
syscolumns c ON b.id = c.id AND a.colid = c.colid
WHERE (b.name = 'dttest2') //dttest2 是自定义的表名
//--获得AdoTable1的主键字段信息
var i:integer;
begin
Adotable1.IndexDefs.Update ;
for i:= 0 to Adotable1.IndexDefs.Count -1 do
if ixPrimary in AdoTable1.IndexDefs.Items[i].Options then
caption:= AdoTable1.IndexDefs[i].Fields;