Page 1 of 1

Newbe - How to lookup databases on server

Posted: 31.03.2006, 15:19
by Cirunz
Hi, I have a MSSQL server with various databases on it and I'd like to fill a combo with the list of this databases so the user can choose wich one he want to connect. There is a way to do such a thing?
I think there is because at design time if I select host and protocol in the Object Inspector than I can select the database to connect exactly in this way, but I don't recognize how to do this.
Thank's

Posted: 20.09.2008, 22:28
by mparak
I think what you need here is the "show databases" command.
Try it.

You are welcome

Mohammed Parak
CAD RETAIL
Durban South Africa
www.cad.co.za

Posted: 21.09.2008, 08:50
by mdaems
Maybe even better : ZConnection.GetSchemanames or GetCatalognames. These functions give TStringLists you can feed directly into a Listbox.

(A quick look at our code in ZPropertyEditor.pas makes me think it's GetCatalogNames.)

Mark