How to enumerate databases?

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
piggles
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 03.08.2007, 21:57

How to enumerate databases?

Post by piggles »

How can I get a list of mysql databases to put in a stringlist so a user can choose one?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Try TZConnection.GetCatalogNames ( TStrings List ) or TZConnection::GetSchemaNames (TStrings List )

Not sure which of both works for mysql. Of course, you'll have to connect to the server first.

Also : make sure the user you connect with has sufficient rights to see other databases!!

Mark
piggles
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 03.08.2007, 21:57

Post by piggles »

Thank you! Get CatalogNames is the one.
Post Reply