VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

GetSQLServers

Brian Battles WS1O  (15 Submissions)   Databases/Data Access/DAO/ADO   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Finds SQL Servers on your LAN

Inputs
Needs you to enter your LAN's Domain name

Assumes
Modified from code originally uploaded by Mike G ([email protected]), which I found had a couple of problems. This version seems to fix them.

Returns
Returns a list of all SQL Servers found, in this example it places them into a combobox control

Side Effects
?

API Declarations
' kernel32 declaration
Private Declare Sub CopyMemory Lib "kernel32" Alias _
"RtlMoveMemory" (Destination As Any, _
Source As Any, _
ByVal Length As Long)
' netapi declarations
Private Declare Function NetServerEnum Lib "netapi32" ( _
strServername As Any, _
ByVal Level As Long, _
bufPtr As Long, _
ByVal PrefMaxLen As Long, _
EntriesRead As Long, _
TotalEntries As Long, _
ByVal ServerType As Long, _
strDomain As Any, _
ResumeHandle As Long) As Long
Private Declare Function NetApiBufferFree Lib "Netapi32.dll" _
(ByVal lpBuffer As Long) As Long

Rate GetSQLServers (4(4 Vote))

Download GetSQLServers

GetSQLServers Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters