Click to See Complete Forum and Search --> : list all databases from a selected server
Karina Gámez
August 24th, 2001, 12:29 PM
hi..
Anybody know how can i list all my databases from "x" server?...
I already list the servers.. but now i have to fill my combo.. with the databases...
so.. any help????
thanks....
sjallad
August 24th, 2001, 02:48 PM
Is it a SQL Server database?
Karina Gámez
August 24th, 2001, 03:03 PM
that´s right... thats a sql server..
and i use trusted and no trusted connections
.. do u know a way to do this?
sjallad
August 24th, 2001, 03:15 PM
Each SQL Server has a table called 'sysdatabases' that is located in the 'master' database. This table keeps track of all databases in that particular server.. How to do this?
Connect to the master database using ADO or whatever you're using.. use the following SQL statement
"SELECT name FROM sysdatabases ORDER BY name"
That should do it..
Karina Gámez
August 24th, 2001, 04:36 PM
hi..
but if i use this.. i need to open the connection... do i????
sjallad
August 27th, 2001, 01:15 PM
Yes.. You open the connection to that SQL server and you connect to the master database
michi
August 27th, 2001, 06:13 PM
For Sql server, you can try 'sp_databases'.
Regards,
Michi
Karina Gámez
September 10th, 2001, 03:07 PM
but i cant open the connection yet...
cause i need to fill my combo and then i can choose my server and then i can choose the databases from that server.. and then i can open the connection using trusted or not trusted..
do u know waht i mean??
it´s a form for login...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.