General information
Category:
Coding, syntax & commands
Certainly....nothing that grand about it. I found some examples that were using SQL-DMO to obtain all sorts of information regarding sql servers.
Anyway...I just put the following in the Click method of a command button:
* create the objects...
oSQLApp = CreateObject('SQLDMO.Application')
oSQLSrv = CreateObject('SQLDMO.sqlserver')
oServers = oSQLApp.ListAvailableSQLServers()
* code that will enumerate through the list of servers
* and add them to the combo box
ThisForm.lstServers.Clear
For i = 1 TO oServers.Count
ThisForm.lstServers.AddItem(oServers.Item(i))
EndFor
If you scan online or in the sql server documentation you'll find all sorts of properties that SQL-DMO exposes.
Hope this helps!
...Douglas
>Could you post the code?
>
>>>I would like to add a combo-box to a form that would display all of the sql servers on the network. Right now, I have some code that I can use to populate the control from the defined data sources (odbc, dsn, etc.) but I would like to also allow the user to select a specific Sql server.
>>>
>>>Thanks...Douglas
>>
>>Replying to myself and anyone else interested....but I figured out how to do this. I found some VB code that I translated for VFP. Now, my only problem is how to figure out why one of the sql servers is not advertising itself on our network.
>>....douglas
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only