Find DB

Can I use ADO to find all DBases in SQL server 200
sycaleAsked:
Who is Participating?
 
raizonConnect With a Mentor Commented:
yes,

connect to the master Database then

query against the sysdatabases table.

Set oconn = New ADODB.COnnection
Set oRs = New ADODB.Recordset

sql = "SELECT name from sysdatabases"

oRs.Open sql, oconn
0
 
raizonCommented:
Or execute the sp_databases stored procedure which is also on the master database
0
 
Éric MoreauSenior .Net ConsultantCommented:
or use OpenSchema from the Connection object
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.