Page 1 of 1
Wrong Fieldnames with UniQuery
Posted: Fri 23 May 2014 11:57
by Kirchi
Hello,
I have a view in my Database. In this View, there are Fieldnames like
VP.Title
State.Title
When I do my SQL Query with Uniquery (Select * From myView) the fieldnames will be Title and Title_01 in the fieldlist of UniQuery. The Setting in Options.FieldsOrigin is True. I want to have the original fieldnames. How can i solve this Problem.
Thanks
Re: Wrong Fieldnames with UniQuery
Posted: Fri 23 May 2014 12:21
by AlexP
Hello,
Please specify the name of the DB you are using.
Re: Wrong Fieldnames with UniQuery
Posted: Fri 23 May 2014 12:29
by Kirchi
It is a MS Access Database.
I am Changing my Application from ADO to UniDAC. In Ado the fieldnames where the same like in the table.
Re: Wrong Fieldnames with UniQuery
Posted: Fri 23 May 2014 13:36
by AlexP
We have checked this behavior in ADO. FieldName for identical fields is created with serial number as well. In UniDAC, to retrieve the real field name, you should set the FieldsOrigin option to True, In this case, the real field name can be retrieved with the Origin property:
Code: Select all
var
i: integer;
begin
UniQuery1.Open;
for i:= 0 to UniQuery1.FieldCount - 1 do
ShowMessage(UniQuery1.Fields[i].Origin);
end;
Re: Wrong Fieldnames with UniQuery
Posted: Fri 23 May 2014 13:55
by Kirchi
The field names are different in the original database (Sample: VP.Title and State.Title) and ADO has taken over these fieldnames. The fieldnames results from a view of multiple tables.
It gets complicated when this function no longer works to rewrite the project.
Re: Wrong Fieldnames with UniQuery
Posted: Mon 26 May 2014 11:25
by AlexP
This is a specificity of Access and ADO (an ability to create views with identical fields). You can leave a suggestion to implement this feature at our uservoice page:
http://devart.uservoice.com/forums/1046 ... components .