Monday, March 12, 2012

How to list all installed MS SQL Server Name by Delphi or other program language

How to list all installed MS SQL Server Name by Delphi or other program language?You can use SQL-DMO to achieve this. Here is some VB code:

Private Function GetAllSqlServerCollection(colSqlServers As Collection)
As
Boolean
Dim intIndex As Integer
Dim oApplication As SQLDMO.Application
Dim oNameList As SQLDMO.NameList

Set oApplication = New Application
With oApplication
Set oNameList = .ListAvailableSQLServers
With oNameList
For intIndex = 1 To .Count
colSqlServers.Add (oNameList.Item(intIndex))
Next
End With
End With
Set oApplication = Nothing
GetAllSqlServerCollection = True
End Function

macka.|||uh whats a delphi

haha|||It is a program language product by Borland (or it may be seen as visual pascal)|||Thank you!
Now, I can solve my problem.

No comments:

Post a Comment