LAN Scanning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am not sure if this is even possible in VB but...
My program connects to an MSSQL Server database. I want to require that the database either be installed on the same machine as my program, or on the same LAN. If the database is installed on the LAN, is there a way I can scan the LAN from within my program to find the database and connet to it?

Thanks,
Tim
 
Hello Tim
Try the following
<code>
Dim oDmoApp As New SQLDMO.Application()
Dim oDmoList As SQLDMO.NameList
Dim i As Integer

'' find all servers
oDmoList = oDmoApp.ListAvailableSQLServers
For i = 1 To oDmoList.Count
Me.ComboBox1.Items.Add
(oDmoApp.ListAvailableSQLServers.Item(i))
Next
</code>
You need to add a reference to Microsoft SQLDMO Object
Library (COM tab)

Kind Regards
Jorge
-----Original Message-----
Hi,

I am not sure if this is even possible in VB but...
My program connects to an MSSQL Server database. I want
to require that the database either be installed on the
same machine as my program, or on the same LAN. If the
database is installed on the LAN, is there a way I can
scan the LAN from within my program to find the database
and connet to it?
 
Back
Top