 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
The Rock Guest
|
Posted: Fri Jun 23, 2006 8:28 am Post subject: EDatabaseError - 'A component named...already exists' |
|
|
Hi - If anyone can assist it would be great
I am generating a quick report (In Delphi 7) (although this same error
occurs on a normal form as well). I have 4 TQuery components used to
extract data from an Interbase 6.0 database. One of my tables holds
"dynamic field information" (e.g. the column names are field1, field2,
field3, field4 etc.)
I create a select query string after the user has selected (in a
checklistbox) which fields (field1, field2, field3 etc.) he would like
to view in the report. The field selection is kept in a TStringList
(FieldList) and then added to the query sql statement.
qry3.Active := false;
qry3.SQL.Clear;
qry3.SQL.Add('select leadid,' +
frmUserLeadStatusRptFilter.FieldList.CommaText);
qry3.SQL.Add('from campaignleads');
qry3.SQL.Add('where leadid = ' + qry2.fieldbyname('leadid').asstring);
qry3.Active := true;
Interestingly, when the user selects all the fields to display I do not
get the error: (it would look like this)
select
leadid,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10,field11,field12,field13
from campaignleads
where leadid = 4130
BUT when the user selects random fields (it would look like this)
select leadid,field1,field6,field7,field8,field9,field10
from campaignleads
where leadid = 3639
I get an error: EDataBaseError with message: "A component named Field6
already exists"
Any ideas? Thanks in advance |
|
| Back to top |
|
 |
Dan Guest
|
Posted: Sun Jul 02, 2006 7:04 am Post subject: Re: EDatabaseError - 'A component named...already exists' |
|
|
On 23 Jun 2006 00:29:03 -0700, "The Rock" <George (AT) neametrics (DOT) com>
wrote:
| Quote: | Hi - If anyone can assist it would be great
I am generating a quick report (In Delphi 7) (although this same error
occurs on a normal form as well). I have 4 TQuery components used to
extract data from an Interbase 6.0 database. One of my tables holds
"dynamic field information" (e.g. the column names are field1, field2,
field3, field4 etc.)
I create a select query string after the user has selected (in a
checklistbox) which fields (field1, field2, field3 etc.) he would like
to view in the report. The field selection is kept in a TStringList
(FieldList) and then added to the query sql statement.
qry3.Active := false;
qry3.SQL.Clear;
qry3.SQL.Add('select leadid,' +
frmUserLeadStatusRptFilter.FieldList.CommaText);
qry3.SQL.Add('from campaignleads');
qry3.SQL.Add('where leadid = ' + qry2.fieldbyname('leadid').asstring);
qry3.Active := true;
Interestingly, when the user selects all the fields to display I do not
get the error: (it would look like this)
select
leadid,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10,field11,field12,field13
from campaignleads
where leadid = 4130
BUT when the user selects random fields (it would look like this)
select leadid,field1,field6,field7,field8,field9,field10
from campaignleads
where leadid = 3639
Try generating the sql string so it looks like this: |
select C.leadid, C.field1, C.field6, C.field7, C.field8, C.field9,
C.field10
from campaignleads C
where leadid = 3639
| Quote: |
I suspect IB is confusing field6 in this query with another field6 it |
has created for something else.
HTH,
Dan
| Quote: | I get an error: EDataBaseError with message: "A component named Field6
already exists"
Any ideas? Thanks in advance |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|