I migrate my application (Delphi 10.3) with MS Access base from ADODB to Firedac.
I have a problem with some TField FieldName when it has a complex name :
Simple example: CREATE TABLE TEST ([SE_NAME] CHAR(3))
On a query like SELECT * FROM TEST T1 LEFT JOIN TEST T2 ON T1.SE_NAME=T2.SE_NAME
I expect FieldNames :'T1.SE_NAME' and 'T2.SE_NAME' (like in Access 2013).
With a ADODB TADOQuery :
var f: TField;
var s: string := '';
for f in Query.Fields do
s := s + f.FieldName + ' ;' ;
s is 'T1.SE_NAME ;T2.SE_NAME ;' OK.
With a Firedac TFDQuery :
var f: TField;
var s: string := '';
for f in Query.Fields do
s := s + f.FieldName + ' ;' ;
s is 'SE_NAME ;SE_NAME_1 ;' : Not OK : FireDac changes the columns names.
How to keep, (with Firedac options ?) , the real columns names, without changing the SQL query (for compatibily needs) ?
In MSAccess (2013) the result of SELECT * FROM TEST T1 LEFT JOIN TEST T2 ON T1.SE_NAME=T2.SE_NAME
is :
Note that :
- I know how to use queries, aliases... but I need to keep the queries for compatibility.
- The queries are just examples (not the real queries).