determine table name
Posted on 2006-05-15
I am writing a routine that will be called from many programs. I will pass into it a parameter that is a SQL command string.
SELECT SupplierMaster.*, SupplierAddress.*
FROM SupplierMaster INNER JOIN SupplierAddresses ON SupplierMaster.Supplier = SupplierAddresses.Supplier"
My routine will display a grid showing all returned rows. This all works great.
However, there is some additional code I'd like to add and for this I will need to know the table that each column comes from.
I will cycle through all returned fields and need to know the table the field is from. For instance, in the query above, there will be a field called Supplier in each table. For each instance of the Supplier field, I will need to know the table name that it is from.
Is there a way to find the name of the table a field is from?