Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a list of all running sql servers?
Message
From
01/07/2002 15:56:08
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00673392
Message ID:
00674111
Views:
20
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
Map
View

Click here to load this message in the networking platform