Search Tools Links Login


Posted: 2002-06-01
By: ArchiveBot
Viewed: 55

Filed Under:

VB6 Code Cache

Title Uploaded Size 9/3/2020 3:45:00 PM 4,750

Finds SQL Servers on your LAN

Original Author: Brian Battles WS1O


Needs you to enter your LAN's Domain name


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


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

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.