Server_DriverInfo() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Retrieves information about the installed toolkits and data sources. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Server_DriverInfo( DriverNo, Attr )

DriverNo is an integer value assigned to an interface toolkit by MapInfo Pro when you start MapInfo Pro.

Attr is a code indicating which information to return.

Return Value

String

Description

The Server_DriverInfo() function returns information about the data sources. The first parameter selects the toolkit (starting at 1). The total number of toolkits can be obtained by a call to the Server_NumDrivers() function. The second parameter selects the kind of information that will be returned. Refer to the following table.

Attr value ID Server_DriverInfo() returns:
SRV_DRV_INFO_NAME 1 String result, the name identifying the toolkit. ODBC indicates an ODBC data source. ORAINET indicates an Oracle Spatial connection.
SRV_DRV_INFO_NAME_LIST 2 String result, returning all the toolkit names, separated by semicolons. Specifically, ODBC, ORAINET. The DriverNo parameter is ignored.
SRV_DRV_DATA_SOURCE 3 String result, returning the name of the data sources supported by the toolkit. Repeated calls will fetch each name. After the last name for a particular toolkit, the function will return an empty string. Calling the function again for that toolkit will cause it to start with the first name on the list again.

Example

Dim dlg_string, source As String
dlg_string = Server_DriverInfo(0, SRV_DRV_INFO_NAME_LIST)
source = Server_DriverInfo(1, SRV_DRV_DATA_SOURCE)
While source <> ""
	Print "Available sources on toolkit " + 
	Server_DriverInfo(1, SRV_DRV_INFO_NAME) + ": " + 
		source
	source = Server_DriverInfo(1,
		SRV_DRV_DATA_SOURCE)
Wend

See Also:

Server_NumDrivers() function