Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server names list in local network
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00417178
Message ID:
00418204
Vues:
36
>I know that you found the answer, but I thought I would throw this out for you (and anyone else) anyway. Try looking up the API fuction NetServerEnum. It will list all servers of the specified type that are visible in a domain. I'm pretty sure that this is what all of the SQL Server applications you are refering to use also. It will not show hidden servers, which is what I have witnessed with the SQL application on our domains.
>
Not a good choice; it only works under NT/2K, and will return a NetAPIBuffer that you have to parse yourself, and explicitly release after extraction of the embedded list of SERVER_INFO_101 structures (they contain UniCode strings as well, a separate issue) otherwise the underlying OS resources will bleed. The same services are available with a whole lot less effort on a cross-platform basis using ADSI, or using enumeration through WNetEnumResources (my NETRSC class contains sample code to enumerate all resources of all types using this API call.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform