开发者

List SQL Express 2005 instances using VB6 code

开发者 https://www.devze.com 2022-12-16 16:08 出处:网络
H开发者_如何转开发ow to list all the instances of SQL Server 2005 Express Edition using vb6 application?This will list all SQL Server instances using SQL-DMO. You will need to filter for Express insta

H开发者_如何转开发ow to list all the instances of SQL Server 2005 Express Edition using vb6 application?


This will list all SQL Server instances using SQL-DMO. You will need to filter for Express instances.

Function listServers(vControl As Object)
    Dim oApp As SQLDMO.Application 
    Dim oNames  As SQLDMO.NameList 

    Set oApp = New SQLDMO.Application 
    Set oNames = oApp.ListAvailableSQLServers() 

    For Each oName In oNames 
        vControl.AddItem oName 
    Next 
End Function 

From here.

This SO question says that it won't find Express instances; need to use SQLBrowseConnect.


This sample is using SQLBrowseConnect API.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号