Share via


Connection.odbcGetInfoInt Method

Provides an interface to the SQLGetInfo Open Database Connectivity (ODBC) function to retrieve information about the ODBC driver and data source that are associated with a connection.

Syntax

public int odbcGetInfoInt(int InfoId)

Run On

Server

Parameters

  • InfoId
    Type: int
    An integer that specifies an ID for the requested information according to the ODBC standard.

Return Value

Type: int
An integer value for the information that is retrieved.

Examples

In the following example, the odbcGetInfoInt method returns an integer value for the maximum length of the column name.

void getConnection() 
{ 
    Connection con; 
    Statement stmt; 
    int info; 
 
    #define.SQL_MAX_COLUMN_NAME_LEN(30) 
    con = new Connection(); 
 
    try 
    { 
        info = con.odbcGetInfoInt(#SQL_MAX_COLUMN_NAME_LEN); 
 
        print info; 
        pause; 
     } 
 
    catch(exception::Error) 
    { 
        print "An error occurred."; 
 
    } 
 
}

See Also

Connection Class

Connection.odbcGetInfoLong Method

Connection.odbcGetInfoStr Method