Re: List availalbe SQL Servers?



Chris.Cheney wrote:
Jouni Aro <jouni.aro@xxxxxxxxx> wrote in
news:47ea39b3@xxxxxxxxxxxxxxxxxxxxxx:

2. Current SQL SMO: the EnumAvailableServers method of the .NET SmoApplication class enumerates a list of available INSTANCES of
Microsoft SQL Server (http://msdn2.microsoft.com/en-
us/library/microsoft.sqlserver.management.smo.smoapplication.enumavail
ables qlservers.aspx).
I am still a novice with .NET - how do you access that from Delphi
win32?

AFAICS MS have not provided a COM-Callable Wrapper for SMO so it seems that you can't.

Well, that's a way to promote .NET, at least... :)

"Available" instances is a misnomer - although an instance may be
available for making a connection to (if you know its server and
instance names), it might not be visible to
List/EnumAvailableSQLServers, one reason being that network
connections for the instance are disabled.
Should SQLEXPRESS be included in the list from SMO (see my response to
Vitali for my server configuration)?

Yes - but I think only if network-enabled.

BTW to run Vitali's code, you will need

uses AdoDB, AdoInt, OleDB, DB, ComObj, ActiveX;

Yes, I figured that out, thanks anyway!

FWIW I have run that code on a computer where there is a default instance of SQL Server 2000 and a (network-disabled) named instance of SQL 2005 Express, and it only finds the SQL Server 2000 instance, whereas SQL Service Manager finds both.

Did you refer to Vitali's code or the SMO here?

However, it is the answer to what you can do when SQL DMO is not supported.

I suppose you mean both the OLEDB/SQLNCLI Enumerator or SMO here?
.



Relevant Pages

  • Cant connect to SQL Server from Novell workstation
    ... My customer is trying to get my VB.net program to access SQL Server 2000 ... over a Novell network and they're getting a connection error. ...
    (microsoft.public.sqlserver.connect)
  • Re: Pass-through queries fail even after SQL Server reconnected
    ... indicates network connectivity problems. ... ODBC is a pretty old way to connect to SQL Server. ... pass-through queries fail due to intermittent connection failures. ... I can easily restablish a connection for ADO. ...
    (comp.databases.ms-access)
  • RE: ASP .Net connection to Sql Server
    ... Using "dbmssocn" tells it to use the TCP/IP network driver, ... It is connecting via a connection string similiar to: ... > string to our production SQL server and everything runs fine. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: java.sql.SQLException (Error establishing socket)
    ... | Error: No active Connection ... Since you are making connections to a remote SQL Server via the Internet, ... If the network is fine, ... Please reply only to the newsgroups. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Error "SQL Server does not allow remote connections"
    ... The application could not connect to the sql server db. ... network is blocking the connection. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 ... integratedSecurity, SqlConnection owningObject) +737554 ...
    (microsoft.public.dotnet.framework.aspnet)