Private Sub Nsqlser_DropDown() If Nsqlser.ListCount > 0 Then Exit Sub Dim Server As SQLDMO.NameList '名字列表namelist Dim appDMO As New SQLDMO.Application 'sqldmo应用 Dim i As Integer Set Server = appDMO.ListAvailableSQLServers '得到所有的sql sever 列表 For i = 1 To Server.Count Nsqlser.AddItem Server(i) 'Nsqlser为下拉列表框 Next End Sub 猜你喜欢