Partilhar via


Connection.odbcGetInfoStr(Int32) Method

Definition

Provides an interface to the SQLGetInfo ODBC function to retrieve information, in string format, about the ODBC driver and data source that are associated with a connection.

public:
 virtual System::String ^ odbcGetInfoStr(int _InfoId);
public virtual string odbcGetInfoStr (int _InfoId);
abstract member odbcGetInfoStr : int -> string
override this.odbcGetInfoStr : int -> string
Public Overridable Function odbcGetInfoStr (_InfoId As Integer) As String

Parameters

_InfoId
Int32

An Integer data type that specifies an ID for the requested information, according to the ODBC standard.

Returns

A String data type value for the information that is retrieved.

Remarks

In the following example, the odbcGetInfoStr method returns the name of the database management system.

void getConnection() 
{ 
    Connection con; 
    str info; 
    #define.SQL_DBMS_NAME(17) 
    con = new Connection(); 
    try 
    { 
        info = con.odbcGetInfoStr(#SQL_DBMS_NAME); 
        print info; 
        pause; 
     } 
    catch(exception::Error) 
    { 
        print "An error occurred."; 
    } 
}

Applies to