軟件測試開發技術SQL Server數據庫對象信息的獲取[3] SQL Server數據庫
關鍵字:sql Dim oDB As SQLDMO.Database
Set oDB = oSQLServer.Databases(cob_sqldb.List(cob_sqldb.ListIndex))
If oCurrentDB Is Nothing Then
Set oCurrentDB = oDB
Else
If oCurrentDB.Name = oDB.Name Then
Exit Sub
End If
Set oCurrentDB = Nothing
Set oCurrentDB = oDB
End If
FillEmptyTableList (True)
If cob_sqltable.ListCount > 0 Then
cob_sqltable.ListIndex = 0
cob_sqltable_Click
End If
......
End Sub
Private Sub FillEmptyTableList(bFill As Boolean)
’獲得當前數據庫中的所有非系統數據表名稱
If bFill = True Then
Dim oTable As SQLDMO.Table
For Each oTable In oCurrentDB.Tables
If oTable.SystemObject = False Then
’判斷其不是系統數據表
cob_sqltable.AddItem oTable.Name
’把非系統數據表名稱添加到數據表信息列表框中
End If
Next oTable
End If
原文轉自:http://www.anti-gravitydesign.com