Re: Listing database servers on local network
From: DKC (anonymous_at_nospam.com)
Date: 04/26/04
- Next message: Jay B. Harlow [MVP - Outlook]: "Re: Using GOTO"
- Previous message: Patrice: "Re: Web.config file"
- In reply to: Cor Ligthert: "Re: Listing database servers on local network"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Apr 2004 15:25:16 +0100
Thanks Cor,
Gave me enough input to proceed further.
Regards,
DKC
"Cor Ligthert" <notfirstname@planet.nl> wrote in message
news:OW$U%2383KEHA.268@TK2MSFTNGP11.phx.gbl...
> Hi DKC
>
> Some sample code, (I think it is only for SQL servers however I do not
know
> it because the sample is not from me)
>
> However maybe you can use it.
>
> Cor
>
> \\\
> Private Function LoadSQLServerList() As Integer
> Dim serverIndex As Integer
> Dim sqlServers As SQLDMO.NameList
> Dim sqlServer As Object
> ' Get a list of servers
> sqlServers = New SQLDMO.Application().ListAvailableSQLServers()
> ' Iterate through the server names, and add it to the combobox
> For Each sqlServer In sqlServers
> If Not sqlServer Is Nothing Then
> cboServers.Items.Add(sqlServer)
> End If
> Next
> ' Send back the count of servers
> LoadSQLServerList = cboServers.Items.Count
> 'table list in a ser
> Dim sqlServer As SQLDMO.SQLServer
> Dim sqlDB As Object
> sqlServer = New SQLDMO.SQLServer()
> Try
> ' Connect to your database with userID and password
> sqlServer.Connect(cboServers.Text, txtUserID.Text,txtPassword.Text)
> ' Check for database names in the server
> ' This loop adds the database name to another combobox
> For Each sqlDB In sqlServer.Databases
> If Not sqlDB.Name Is Nothing Then
> cboDatabases.Items.Add(sqlDB.name)
> End If
> Next
> Catch Exp As Exception
> MsgBox(Exp.ToString)
> End Try
> ////
>
>
- Next message: Jay B. Harlow [MVP - Outlook]: "Re: Using GOTO"
- Previous message: Patrice: "Re: Web.config file"
- In reply to: Cor Ligthert: "Re: Listing database servers on local network"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|