f2s_mssql_server_list_count¶

Applies to: MS SQL

Syntax

**There is no set_attribute.  This attribute is read only.**
get_attribute f2s_mssql_server_list_count of {DriverID} to {variable}

Parameter

Description

DriverID

The ID of the driver for which this applies. In most cases, you should use _f2s_ActiveDriverID.

variable

Variable to hold the number of servers found on the network.

Description

Getting this read only attribute returns the number of available MSSQL servers detected in the the network. When used with f2s_mssql_server_list_item_at, all the available server names can easily be retrieved.

Note: Getting this attribute can take a few moments to return a value.

Note: The SQL Server Browser service must be running for this attribute to return a valid value.

Examples

get_attribute

Integer iNumServers iIndex
String sServer

get_attribute f2s_mssql_server_list_count of _f2s_ActiveDriverID to iNumServers
Showln (SFormat("There are %1 MSSQL servers available.",iNumServers))
If (iNumServers>0) Begin
    Showln "They are:"
    For iIndex from 0 to (iNumServers-1)
      get_attribute f2s_mssql_server_list_item_at of _f2s_ActiveDriverID (iIndex+1) to sServer
      Showln sServer
    Loop

End

Related Attributes

Replaces: Command GET_NO_AVAILABLE_SQLSERVERS