How to visualize in a combo box, all the SQL server on my computer?
Hi!
I want to create a form, where I insert my userID, my Password ecc... and a combo box, where I can see all the active server on my computer, and I can choose one of it!
It's possible to realize that?
Thank you!
[230 byte] By [
top.gun1] at [2007-12-17]
You can use SQLDMO. While it doesn't work at all times it shouldn't be a concern because all tools I know of also doesn't list available servers at all times. ie:
Local oSQLDMO as SQLDMO.SQLserver,oSQLDMO2 as SQLDMO.SQLserver2
Local oNames as SQLDMO.NameList,oNames2 as SQLDMO.NameList
oSQLDMO = CreateObject("SQLDMO.SQLserver")
oNames = oSQLDMO.Application.ListAvailableSQLServers()
For ix=1 to oNames.Count
? oNames.Item[ix]
endfor
* Get local instances too
oSQLDMO2 = CreateObject("SQLDMO.SQLserver2")
oNames2 = oSQLDMO2.ListInstalledInstances()
For ix=1 to oNames2.Count
? oNames2.Item[ix]
endfor