Search Tools Links Login

GetSQLServers


Visual Basic 6, or VB Classic

Finds SQL Servers on your LAN

Original Author: Brian Battles WS1O

Inputs

Needs you to enter your LAN's Domain name

Assumptions

Modified from code originally uploaded by Mike G (mikeg@ivbnet.com), 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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 85 times

Categories

Visual Basic 6

Attachments

GetSQLServ184584162001.zip
Posted: 9/3/2020 3:45:00 PM
Size: 4,750 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.