Thread View: comp.lang.pascal.delphi.databases
3 messages
3 total messages
Started by abaab hichem
Wed, 21 Apr 1999 00:00
Please Help
Author: abaab hichem
Date: Wed, 21 Apr 1999 00:00
Date: Wed, 21 Apr 1999 00:00
27 lines
1771 bytes
1771 bytes
Hi,
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.Close;
FormDatacpl.sqlcontactclient.SQL.clear;
FormDatacpl.sqlcontactclient.SQL.Add('SELECT
Dbo_contactclient.REFCLIENT, Dbo_contactclient.STATUT,
Dbo_contactclient.NOM');
FormDatacpl.sqlcontactclient.SQL.Add('dbo_contactclient.PRENOM,
Dbo_contactclient.DATENAISS, Dbo_contactclient.LANGUE,
Dbo_contactclient.FONCTION, Dbo_contactclient.TEL');
FormDatacpl.sqlcontactclient.SQL.Add ('Dbo_contactclient.GSM,
Dbo_contactclient.FAX');
FormDatacpl.sqlcontactclient.SQL.Add(' Dbo_contactclient.E_MAIL,
Dbo_contactclient.NOTE');
FormDatacpl.sqlcontactclient.SQL.Add('FROM
":BASE_CPL:dbo.CONTACTCLIENT" ');
FormDatacpl.sqlcontactclient.SQL.Add('JOIN ":cubic3:Scli01" ');
FormDatacpl.sqlcontactclient.SQL.Add ('ON (Dbo_contactclient.REFCLIENT
= Scli01.C_NUMERO)');
FormDatacpl.sqlcontactclient.ExecSQL;
FormDatacpl.sqlcontactclient.open;
Thank in advance!
Re: Please Help
Author: 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)
Re: Please Help
Author: Menno Holscher
Date: Sun, 25 Apr 1999 00:00
Date: Sun, 25 Apr 1999 00:00
11 lines
1155 bytes
1155 bytes
abaab hichem wrote: > FormDatacpl.sqlcontactclient.ExecSQL; > FormDatacpl.sqlcontactclient.open; > > Thank in advance! Take out the ExecSQL. Use ExecSQL when your query does not return rows. Open if it does. So : Update Client set town = 'London' would need an ExecSQL, Select * from client would need an Open. HTH
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads