Purpose
Returns specific information about a database connection of an open table. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
TableConnectionInfo( tableAlias, connectionIndex, connectionInfoCode )
tableAlias is the "alias" name of an open table.
connectionIndex is the index of database connection for which you need information. The index value may range from 1 to the count of connections. See TableInfo() function for identifying the count of database connections for the open table.
If an invalid connectionIndex is supplied, an error will occur when executing the command.
connectionInfoCode is a code indicating the type of information to return; see table below.
Return Value
SmallInt.
Description
The TableConnectionInfo() function returns one piece of information about a database connection of an open table. A table can potentially have more than one open database connections. This command can be used to get information about each open connection that a table has.
The connectionIndex is a value that represents the count of database connection of an open table for which you want information. You can obtain the count of available database connections by calling the TableInfo() function with the TAB_INFO_CONNECTIONS_COUNT attribute. If an invalid connectionIndex is supplied, an error will occur when executing the command.
The connectionInfoCode parameter can be any value from the table below. Codes in the left column are defined in MAPBASIC.DEF.
connectionInfoCode code | ID | TableConnectionInfo() returns |
---|---|---|
TABLE_CONNECTION_INFO_NUMBER | 1 | SmallInt result, indicating the connection number. You can use the connection number to get more information about the connection by using the Server_ConnectInfo() function. |
Examples
The following example will return the connection number for the first database connection of the open table.
TableConnectionInfo(tableAlias, 1, 1)
TableConnectionInfo(tableAlias, 2, 1)
See Also: