Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

heterogeneous JOIN

Posted on 2001-07-03
7
Medium Priority
?
521 Views
Last Modified: 2012-05-04
I have a question a bit like this open already, but since I need the answer now I will try to ask it again.
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20144514

I try this example: http://community.borland.com/article/0,1410,25204,00.html
It shows how to move data betweem two databases, using two TDatabases with databasenames: aaa,bbb and one Query with this SQL statement
INSERT INTO ":aaa:Country" SELECT * FROM ":bbb:Country"

I get this error: No such table or correlation name, when I try to execute it.

If I use the aliases instead of the databasenames it works fine, but I then have to enter the password and username explicitly, how do I remove this login-dialog.

I uses Interbase, I know that interbase doesn't support heterogeneous JOIN and that BDE performs the function instead.
0
Comment
Question by:glx2k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6249045
Did you set both TDatabase.LoginPrompt to false?
0
 

Author Comment

by:glx2k
ID: 6249054
yes of course :-)
0
 
LVL 9

Accepted Solution

by:
ITugay earned 800 total points
ID: 6249371
Hi glx2k,

here is sample procedure that able open database without login dialog.

!!!Important!!!!! All TQuery and TTable inside your app. must be inactive (active = false).

procedure OpenDatabase(DBName, User, Password: String);
var
  D: TDatabase;
begin
  D := Session.FindDatabase(DBName);
  if D = nil
    then D:=TDatabase.Create(Session);
  D.DatabaseName := DBName;
  D.LoginPrompt := false;
  D.Params.Clear;
  D.Params.Add('USER NAME=' + User);
  D.Params.Add('PASSWORD=' + Password);
  D.Open;
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
  OpenDatabase('IBWORK', 'SYSDBA', 'masterkey');
  Query1.Open;
end;


-----
Igor

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:glx2k
ID: 6249687
Hmm Igor ... it seems to work, I will test it a bit more, but great news so far :)

I don't understand why it works, I have tried the same thing with a TDatabase at design time.
When I try to set DatabaseName I get a duplicate database error, but your code works fine.
0
 

Expert Comment

by:LucasC
ID: 6252577
I think your TQuery must have the Database property blanked (no Database selected) to allow you use heterogeneus joins.
Did you tried it?
Good Luck
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6252598
I have no idea what's wrong. Can you show me your code?
0
 

Author Comment

by:glx2k
ID: 6253576
Yes, but I think I have handled the problem :)
So thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question