SUMMARY
A query against tables having columns with the same name results in a
recordset with duplicate field names. This makes it difficult to identify the
parent table of the fields with the same name.
For example:
TABLE1 TABLE2
------- -------
col col
If the statement "select * from table1, table2" is issued, there will be
two fields in the resulting recordset with the name of "col". ActiveX Data
Objects (ADO) does not rename any columns. To workaround this, alias the
column names as indicated in the following example:
select Table1.col as A table2.col as B from a, b
If you do not alias the column names you can use the field property
BASETABLENAME to determine the parent tablename.
Note:Dynamic field properties
are not set for forward only read-only cursors.
The following code prints the basetable name:
rs.open "...",cn,adOpenKeyset
debug.print rs(0).properties("BASETABLENAME")
Getting the information about the BASETABLENAME is an expensive
proposition and many backends do not readily provide this information.