Solved

Find DB

Posted on 2002-05-29
3
140 Views
Last Modified: 2010-05-02
Can I use ADO to find all DBases in SQL server 200
0
Comment
Question by:sycale
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
raizon earned 100 total points
ID: 7042513
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
 
LVL 5

Expert Comment

by:raizon
ID: 7042526
Or execute the sp_databases stored procedure which is also on the master database
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7042634
or use OpenSchema from the Connection object
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now