C
coolblue
Unregistered / Unconfirmed
GUEST, unregistred user!
Var
Session11:TSession;
DataBase11:TDataBase;
Query11:TQuery;
Datasource11:TDatasource;
begin
{ Run two separate queries, each in their own thread }
//RunBackgroundQuery(Session1, DataBase1, Query1,Datasource1);
//RunBackgroundQuery(Session2, DataBase2, Query2,Datasource2);
Session11 := TSession.Create(Application);
Session11.Name := 'Session11';
Session11.SessionName := 'Ses11';
Session11.Active := True;
DataBase11 := TDataBase.Create(Application);
DataBase11.Name := 'DataBase11';
DataBase11.AliasName := 'GSMMonitor';
DataBase11.DatabaseName := 'DB1';
DataBase11.LoginPrompt := False;
DataBase11.Params.Add('USER NAME=sa');
DataBase11.Connected := True;
Query11 := TQuery.Create(Application);
Query11.Name := 'Query11';
Query11.SessionName := Session11.SessionName;
Query11.DatabaseName := DataBase11.DatabaseName;
Query11.SQL.Add('Select * from JZZT');
Query11.Open;----------------------------------------->出错:Unknown database.Alias DB1
Datasource11 := TDatasource.Create(Application);
RunBackgroundQuery(Session11, DataBase11, Query11,Datasource11);
//RunBackgroundQuery(Session21, DataBase21, Query21,Datasource21);
Session11:TSession;
DataBase11:TDataBase;
Query11:TQuery;
Datasource11:TDatasource;
begin
{ Run two separate queries, each in their own thread }
//RunBackgroundQuery(Session1, DataBase1, Query1,Datasource1);
//RunBackgroundQuery(Session2, DataBase2, Query2,Datasource2);
Session11 := TSession.Create(Application);
Session11.Name := 'Session11';
Session11.SessionName := 'Ses11';
Session11.Active := True;
DataBase11 := TDataBase.Create(Application);
DataBase11.Name := 'DataBase11';
DataBase11.AliasName := 'GSMMonitor';
DataBase11.DatabaseName := 'DB1';
DataBase11.LoginPrompt := False;
DataBase11.Params.Add('USER NAME=sa');
DataBase11.Connected := True;
Query11 := TQuery.Create(Application);
Query11.Name := 'Query11';
Query11.SessionName := Session11.SessionName;
Query11.DatabaseName := DataBase11.DatabaseName;
Query11.SQL.Add('Select * from JZZT');
Query11.Open;----------------------------------------->出错:Unknown database.Alias DB1
Datasource11 := TDatasource.Create(Application);
RunBackgroundQuery(Session11, DataBase11, Query11,Datasource11);
//RunBackgroundQuery(Session21, DataBase21, Query21,Datasource21);