调用系统存储过程sp_helpdb，VB例程(DAO) 
     Dim r As Recordset,db As Database,wks as Workspace 
     Set wks = DBEngine.CreateWorkspace("myWks", "Admin", "", dbUseODBC) 
     Set Db = wks.OpenDatabase("", dbDriverNoPrompt, 0, "ODBC;SERVER=MYSERVER;DRIVER={SQL SERVER};DSN='';UID=sa;DATABASE=master;PWD=;") 
     Set r = db.OpenRecordset("sp_helpdb") 
     Do While Not r.EOF 
     debug.print r!Name 
     r.MoveNext 
     Loop 
     r.Close 
     
     db.Close 
     wks.Close 
<END>     
Dim svr As New SQLDMO.SQLServer 
    Dim db As SQLDMO.Database 
    Dim i As Integer 
    svr.Connect "(local)", "sa" 
    Set db = svr.Databases("pubs") 
    For i = 1 To db.Tables.Count 
     Debug.Print db.Tables(i).Name 
    next 
<END>

    