熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> SQL Server >> 正文

SQL Server數據庫對象信息的獲取[2]

2022-06-13   來源: SQL Server 
    Set oSQLServer = CreateObject(SQLDMOSQLServer)

    oSQLServerConnect SERVER_NAME USERNAME PASSWORD

    連接SQL Server服務器SERVER

    _NAME 為服務器名USERNAME為用戶名PASSWORD為用戶口令

    FillEmptyDatabaseList (True)

    If cob_sqldbListCount > Then

        cob_sqldbListIndex =

        Cob_sqldb_Click

    End If

    

    End Sub

    Private Sub FillEmptyDatabaseList(bFill As Boolean)

    獲得SQL Server服務器上的所有數據庫名稱

    If bFill = True Then

        Dim oDB As SQLDMODatabase

        Set oDB = New SQLDMODatabase

        For Each oDB In oSQLServerDatabases

            If oDBSystemObject = False Then

                判斷其不是系統數據庫

                cob_sqldbAddItem oDBName

                把非系統數據庫名稱添加到數據庫信息列表框中

            End If

            Next oDB

        End If

    End Sub

    Private Sub Cob_sqldb_Click()

    點擊數據庫信息列表框

    

[]  []  []  []  


From:http://tw.wingwit.com/Article/program/SQLServer/201311/22456.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.