2 Tsqlconnection and 1 Tsqltable (Mysql)


2008-05-01 07:31:14 PM
delphi160
Hello, I have trouble changing TSQLTABLE.TsqlConnection at run time..
I am using the DBexpress component and Borland Developer Studio 2006 to
connect to MYSQL 5.0
I have a TSQLTable called tsqltable
Then I have 2 TSQLconnections pointing to different Catalogs on the server
both catalogs on the server have a table called users
Tsqlcon1
Tsqlcon2
Then I try to do this
//LOOP 1
Tsqltable.close;
tsqltable.SQLConnection:=Tsqlcon1; // Connecting to number 1
tsqltable.TableName:='users';
tsqltable.Open;
list_table(tsqltable); // Test procedure
tsqltable.close;
//LOOP2
Tsqltable.close;
// Think I need to do something here ??
tsqltable.SQLConnection:=Tsqlcon2; // Connecting to number 2 but somhow
still keeping number 1
tsqltable.TableName:='users';
tsqltable.Open;
list_table(tsqltable); // Test procedure
tsqltable.close;
The LOOP 2 still keep the connection to TSQLcon1, how can I loose the first
connection and then connect to the second?
Thanks in advance..
Regards
B