How to get the table name from a field in a join query with MSSQL? (mysql_field_table equivalent)

回眸只為那壹抹淺笑 提交于 2019-12-03 07:37:40

You could use a TADODataSet to fetch the Recordset, iterate the Fields collection, and get the tables/fields names like this:

for I := 0 to ADODataSet1.Recordset.Fields.Count - 1 do
begin
  TableName := ADODataSet1.Recordset.Fields[i].Properties['BASETABLENAME'].Value;
  FieldName := ADODataSet1.Recordset.Fields[i].Properties['BASECOLUMNNAME'].Value;
end;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!