Set oSQLServer = CreateObject(
SQLDMO
SQLServer
)
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()
点击数据库信息列表框
[] [] [] []