Newbe - How to lookup databases on server

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Cirunz
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 31.03.2006, 15:12
Location: Rome
Contact:

Newbe - How to lookup databases on server

Post 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
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Post 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
Last edited by mparak on 24.09.2008, 22:21, edited 1 time in total.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Post Reply