Fix firing queries on correct DB when user selects another DB in "Source" tab. Broken in rev 687.

This commit is contained in:
Ansgar Becker
2007-07-04 20:10:39 +00:00
parent 79c95bd9fd
commit efcc58f7bb

View File

@@ -448,6 +448,7 @@ var
sql_select : String;
cwin : TMDIChild;
query : TDataSet;
OldActualDatabase : String;
begin
// export!
pageControl1.ActivePageIndex := 0;
@@ -523,7 +524,9 @@ begin
try
// Be sure to read everything from the correct database
cwin.ExecUseQuery( comboSelectDatabase.Text );
OldActualDatabase := cwin.ActualDatabase;
cwin.ActualDatabase := comboSelectDatabase.Text;
cwin.EnsureActiveDatabase;
{***
Ouput useful header information only when exporting to file
@@ -1066,9 +1069,10 @@ begin
RemoteExecNonQuery(win2export, sql );
end;
if cwin.ActualDatabase <> '' then
if OldActualDatabase <> '' then
begin
cwin.ExecUseQuery( cwin.ActualDatabase );
cwin.ActualDatabase := OldActualDatabase;
cwin.EnsureActiveDatabase;
end;
FINALLY
if tofile then