Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Databases > Re: EDatabaseEr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 920 of 987
Post > Topic >>

Re: EDatabaseError - 'A component named...already exists'

by Dan <Doculus at CMDCsystems dot com> Jul 1, 2006 at 08:04 PM

On 23 Jun 2006 00:29:03 -0700, "The Rock" <George@[EMAIL PROTECTED]
>
wrote:

>Hi - If anyone can assist it would be great
>
>I am generating a quick re****t (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 re****t. 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
>
I suspect IB is confusing field6 in this query with another field6 it
has created for something else.

HTH,
Dan

>I get an error: EDataBaseError with message: "A component named  Field6
>already exists"
>
>Any ideas? Thanks in advance
 




 2 Posts in Topic:
EDatabaseError - 'A component named...already exists'
"The Rock" <  2006-06-23 00:29:03 
Re: EDatabaseError - 'A component named...already exists'
Dan <Doculus at CMDCsy  2006-07-01 20:04:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 12:27:33 CDT 2008.