Switch Database with ZConnection.Database
Posted: 27.02.2006, 21:44
Hello,
I have a ZConnection1 and a ZQuery1 but I can only define the Database once.
Shouldn't the ZConnection have recognized that I want to select the table2 in database2, not in database1 ?
Greetings,
Anse
I have a ZConnection1 and a ZQuery1 but I can only define the Database once.
Code: Select all
ZConnection1.Database := 'test1';
ZQuery1.SQL.Add('SELECT * FROM table1');
ZQuery1.Open(); // This runs as expected!
ZQuery1.Close();
ZConnection1.Database := 'test2';
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add('SELECT * FROM table2'); // no error till here
ZQuery1.Open(); // This returns "SQL-error: Table test1.table2 does not exist"
Greetings,
Anse