Hi,
is there a way to get the table name of my query or must I extract it from the SQL.Text property myself?
Thx.
Get the Table name?
Yes, this one of the ways.
Another way is to check to what table belongs a field in your dataset. It may look like this:
Note, some fields may not belong to a table. This concerns lookup and calculated fields, fields that are the result of a function, etc.
Another way is to check to what table belongs a field in your dataset. It may look like this:
Code: Select all
uses
MyClasses;
...
var
FieldDesc: TMySQLFieldDesc;
...
FieldDesc := TMySQLFieldDesc(MyQuery1.GetFieldDesc(MyQuery1.FieldByName('deptno')));
ShowMessage(FieldDesc.TableInfo.TableName);