Article View: comp.lang.pascal.delphi.databases
Article #25Re: Please Help
From: Steve Koterski
Date: Wed, 21 Apr 1999 00:00
Date: Wed, 21 Apr 1999 00:00
52 lines
3056 bytes
3056 bytes
On Wed, 21 Apr 1999 15:14:43 +0200, abaab hichem
<abaab.hichem@mail.switchon.be> wrote:
>I made an application in delphi 4 Client Server that uses lots of
>databases , I want to use a heterogenous queries, but when I running my
>application I get the error message " No such table or correlation
>name" here's my code :
>
[...]
> FormDatacpl.sqlcontactclient.SQL.Add('FROM
>":BASE_CPL:dbo.CONTACTCLIENT" ');
> FormDatacpl.sqlcontactclient.SQL.Add('JOIN ":cubic3:Scli01" ');
[...]
What are these tokens "BASE_CPL" and "cubic3"? Are they the names of BDE
aliases? Or are they the values from the DatabaseName properties of
TDatabase components? If they are aliases, you might try the opposite
approach, using TDatabase components (which may, in their turn, use an
alias to connect to the database).
Set up two TDatabase components to connect to these two databases. Set the
AliasName properties of each to use a BDE alias that points to one of the
particular databases. Set up the Params and LoginPrompt properties as
needed to handle logins. Then, assign an arbitrary but meaningful value to
the DatabaseName properties. Do not use a String that is the same as the
name of any existing BDE alias. For example, you might use the String
valuesd "DB1" and "DB2".
Then, in your SQL statement, use these two values in the statement.
...
FROM ":DB1:dbo.CONTACTCLIENT"
JOIN ":DB2:Scli01"
...
If you still get the error, try explicitly setting the Connected properties
of the two TDatabase components to True prior to activating the TQuery.
> FormDatacpl.sqlcontactclient.ExecSQL;
> FormDatacpl.sqlcontactclient.open;
And, speaking of activating TQuery components, use the Open method when the
SQL statement returns a result set. Only SELECT statements do so. Use
ExecSQL for any other type of SQL statement (INSERT, DELETE, ALTER TABLE,
CREATE INDEX, and so on) that do not retrieve a result set. You will never,
ever use both methods for the same query.
//////////////////////////////////////////////////////////////////////////
Steve Koterski "There are two kinds of pedestrians...the
Technical Publications quick and the dead."
INPRISE Corporation -- Lord Thomas Robert Dewar
http://www.borland.com/delphi (1864-1930)
Technical Details
Message-ID:
<371eff04.4261838@newslist>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<371DCF43.698E0A73@mail.switchon.be>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ffff5,62dd99384bc7a75a X-Google-Attributes: gidffff5,public X-Google-Thread: 115d96,62dd99384bc7a75a X-Google-Attributes: gid115d96,public From: skoterski@NOSPAMinprise.com (Steve Koterski) Subject: Re: Please Help Date: 1999/04/21 Message-ID: <371eff04.4261838@newslist> X-Deja-AN: 469194643 Content-Transfer-Encoding: 7bit References: <371DCF43.698E0A73@mail.switchon.be> Content-Type: text/plain; charset=us-ascii Organization: INPRISE Corporation, Technical Publications Mime-Version: 1.0 Reply-To: skoterski@NOSPAMinprise.com Newsgroups: comp.lang.pascal.delphi.databases,borland.public.delphi.database