Board index » delphi » D7.1 TSQLConnection issue w/MySQL

D7.1 TSQLConnection issue w/MySQL


2004-05-17 07:05:19 PM
delphi84
uses D7.1, MySQL 3.23.58
to whom,
I am not sure if this exposes a bug, fix, feature, or simply bad
programming on my part, but it broke my code, and I'd
like to see what people think.
before D7.1, this worked:
SQLConnection1.Open; // initial parameters point at OldDataBase
// do some things
SQLConnection1.Params.Values['Database'] := 'NewDataBase';
SQLConnection1.GetTableNames(ListBox1.Items, False);
// Listbox contains list of tables in NewDataBase
after D7.1
ListBox contains list of tables in OldDataBase :(
the only way I can seem to make it read the table list correctly
is to close and re-open the SQLConnection.
comment?
-paladin
 
 

Re:D7.1 TSQLConnection issue w/MySQL

To be honest, I am skeptical that the pre-7.1 result was as you say, but
when I get a chance I will test it.
As for your 7.1 results, they are IMHO entirely correct.
H
"paladin" <XXXX@XXXXX.COM>writes
Quote
uses D7.1, MySQL 3.23.58

to whom,
I am not sure if this exposes a bug, fix, feature, or simply bad
programming on my part, but it broke my code, and I'd
like to see what people think.

before D7.1, this worked:

SQLConnection1.Open; // initial parameters point at OldDataBase
// do some things
SQLConnection1.Params.Values['Database'] := 'NewDataBase';
SQLConnection1.GetTableNames(ListBox1.Items, False);
// Listbox contains list of tables in NewDataBase

after D7.1
ListBox contains list of tables in OldDataBase :(

the only way I can seem to make it read the table list correctly
is to close and re-open the SQLConnection.

comment?
-paladin


 

Re:D7.1 TSQLConnection issue w/MySQL

Connection Params such as Database,... should be set before Open. In your
case do a Close and Open connection to the new database to get the new list
of tables.
T.Ramesh.
"paladin" <XXXX@XXXXX.COM>writes
Quote
uses D7.1, MySQL 3.23.58

to whom,
I am not sure if this exposes a bug, fix, feature, or simply bad
programming on my part, but it broke my code, and I'd
like to see what people think.

before D7.1, this worked:

SQLConnection1.Open; // initial parameters point at OldDataBase
// do some things
SQLConnection1.Params.Values['Database'] := 'NewDataBase';
SQLConnection1.GetTableNames(ListBox1.Items, False);
// Listbox contains list of tables in NewDataBase

after D7.1
ListBox contains list of tables in OldDataBase :(

the only way I can seem to make it read the table list correctly
is to close and re-open the SQLConnection.

comment?
-paladin


 

Re:D7.1 TSQLConnection issue w/MySQL

are you skeptical enough to wager an enormous amount of money?
-paladin
"Hugh Jones" <XXXX@XXXXX.COM>writes news:40a8a748$XXXX@XXXXX.COM...
Quote
To be honest, I am skeptical that the pre-7.1 result was as you say, but
when I get a chance I will test it.

As for your 7.1 results, they are IMHO entirely correct.

H

"paladin" <XXXX@XXXXX.COM>writes
news:40a89ac7$XXXX@XXXXX.COM...
>uses D7.1, MySQL 3.23.58
>
>to whom,
>I am not sure if this exposes a bug, fix, feature, or simply bad
>programming on my part, but it broke my code, and I'd
>like to see what people think.
>
>before D7.1, this worked:
>
>SQLConnection1.Open; // initial parameters point at OldDataBase
>// do some things
>SQLConnection1.Params.Values['Database'] := 'NewDataBase';
>SQLConnection1.GetTableNames(ListBox1.Items, False);
>// Listbox contains list of tables in NewDataBase
>
>after D7.1
>ListBox contains list of tables in OldDataBase :(
>
>the only way I can seem to make it read the table list correctly
>is to close and re-open the SQLConnection.
>
>comment?
>-paladin
>
>


 

Re:D7.1 TSQLConnection issue w/MySQL

ramesh,
but doesn't closing and re-opening the connection go through
the entire MySQL login/password sequence again? Seems
like alot of overhead for something so simple, especially when
we have a property like KeepConnection?
The app that got broken is a db-explorer type thing that lists
all available databases and tables on a MySQL server.
I do not mind implementing your suggestion, nor do I mean
to pester you with questions. Just trying to learn from the masters...
-paladin
 

Re:D7.1 TSQLConnection issue w/MySQL

Execute this sql before to get the table names:
"use <newdatabase name>"
Regards,
Cristian Nicola
"paladin" <XXXX@XXXXX.COM>writes
Quote
ramesh,

but doesn't closing and re-opening the connection go through
the entire MySQL login/password sequence again? Seems
like alot of overhead for something so simple, especially when
we have a property like KeepConnection?

The app that got broken is a db-explorer type thing that lists
all available databases and tables on a MySQL server.

I do not mind implementing your suggestion, nor do I mean
to pester you with questions. Just trying to learn from the masters...

-paladin


 

Re:D7.1 TSQLConnection issue w/MySQL

Forgot to mention .. while you are at it could you give it a try to
microolap.com/dbx/mysql/index.htm
Regards,
Cristian Nicola
"paladin" <XXXX@XXXXX.COM>writes
Quote
ramesh,

 

Re:D7.1 TSQLConnection issue w/MySQL

Paladin,
You could also try the suggestion by Cristian to use "Use database" rather
than disconnecting from the database.
T.Ramesh.
"paladin" <XXXX@XXXXX.COM>writes
Quote
ramesh,

but doesn't closing and re-opening the connection go through
the entire MySQL login/password sequence again? Seems
like alot of overhead for something so simple, especially when
we have a property like KeepConnection?

The app that got broken is a db-explorer type thing that lists
all available databases and tables on a MySQL server.

I do not mind implementing your suggestion, nor do I mean
to pester you with questions. Just trying to learn from the masters...

-paladin


 

Re:D7.1 TSQLConnection issue w/MySQL

cristian
thankyou, the 'Use' idea seems to work. I recall evaluating your
microOLAP drivers back when I first started with D6, but rejected
them for ?? (can't remember) reason[s]. certainly cost was one.
I'd like to re-evaluate but the link to download the demo:
microolap.com/dbx/mysql/dbx4mysql.zip
seems to result in a file that is not a valid zip archive?
interestingly enough (or should I say, skeptically enough?),
simply issuing a close in between gettablenames seems to
work also, eg.
SQLConnection1.Params.Values['DataBase'] := 'DB_ONE';
SQLConnection1.GetTableNames(ListBox1.Items);
SQLConnection1.Close;
SQLConnection1.Params.Values['DataBase'] := 'DB_TWO';
SQLConnection1.GetTableNames(ListBox2.Items);
SQLConnection1.Close;
SQLConnection1.Params.Values['DataBase'] := 'DB_THREE';
SQLConnection1.GetTableNames(ListBox3.Items);
implying that GetTableNames opens the connection and
leaves it open.
-paladin
 

Re:D7.1 TSQLConnection issue w/MySQL

:)
No.
But I am going to test it.
H
"paladin" <XXXX@XXXXX.COM>writes
Quote


are you skeptical enough to wager an enormous amount of money?


-paladin



"Hugh Jones" <XXXX@XXXXX.COM>writes
>To be honest, I am skeptical that the pre-7.1 result was as you say, but
>when I get a chance I will test it.
>
>As for your 7.1 results, they are IMHO entirely correct.
>
>H
>
>"paladin" <XXXX@XXXXX.COM>writes
>news:40a89ac7$XXXX@XXXXX.COM...
>>uses D7.1, MySQL 3.23.58
>>
>>to whom,
>>I am not sure if this exposes a bug, fix, feature, or simply bad
>>programming on my part, but it broke my code, and I'd
>>like to see what people think.
>>
>>before D7.1, this worked:
>>
>>SQLConnection1.Open; // initial parameters point at OldDataBase
>>// do some things
>>SQLConnection1.Params.Values['Database'] := 'NewDataBase';
>>SQLConnection1.GetTableNames(ListBox1.Items, False);
>>// Listbox contains list of tables in NewDataBase
>>
>>after D7.1
>>ListBox contains list of tables in OldDataBase :(
>>
>>the only way I can seem to make it read the table list correctly
>>is to close and re-open the SQLConnection.
>>
>>comment?
>>-paladin
>>
>>
>
>


 

Re:D7.1 TSQLConnection issue w/MySQL

The archive is ok.. please try to download it again..
Cristian
"paladin" <XXXX@XXXXX.COM>writes
Quote
microolap.com/dbx/mysql/dbx4mysql.zip
seems to result in a file that is not a valid zip archive?
 

Re:D7.1 TSQLConnection issue w/MySQL

Quote
interestingly enough (or should I say, skeptically enough?),
simply issuing a close in between gettablenames seems to
work also, eg.
ok - I didn't mean to irritate you, though clearly I did.
Perhaps I meant 'surprised' rather than skeptical.
 

Re:D7.1 TSQLConnection issue w/MySQL

Who are you writing to?
Cristian Nicola
"Hugh Jones" <XXXX@XXXXX.COM>writes
Quote
ok - I didn't mean to irritate you, though clearly I did.
Perhaps I meant 'surprised' rather than skeptical.


 

Re:D7.1 TSQLConnection issue w/MySQL

Cristian, my response was for paladin.
"Cristian" <XXXX@XXXXX.COM>writes
Quote
Who are you writing to?

Cristian Nicola

"Hugh Jones" <XXXX@XXXXX.COM>writes
news:40a9c656$XXXX@XXXXX.COM...
>ok - I didn't mean to irritate you, though clearly I did.
>Perhaps I meant 'surprised' rather than skeptical.
>
>


 

Re:D7.1 TSQLConnection issue w/MySQL

"Hugh Jones" wrote
Quote
ok - I didn't mean to irritate you, though clearly I did.
Perhaps I meant 'surprised' rather than skeptical.
No no no. I said that more tongue-in-cheek. After 2
years of dealing with dbexpress and midas bugs and
no source code, any nerve endings that *could* be
irritated are now covered with deep scar tissue.
Quote
But I am going to test it.
Any inkling of time-frame?
and will you answer back here?
tia,
pal