Help Center

CODBCStmt.GetStmtMaxLengthmethod

Gets an SQLUINTEGER value that specifies the maximum amount of data that the driver returns from a character or binary column.

DatabasesmethodCODBCStmt.incdocumented

Syntax

FUNCTION GetStmtMaxLength () AS SQLUINTEGER

Return value

The maximum amount of data that the driver returns from a character or binary column.

Result code (GetLastResult)

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.

Description

Gets an SQLUINTEGER value that specifies the maximum amount of data that the driver returns from a character or binary column. Optional feature not implemented by the Microsoft Access Driver.

Remarks

If dwAttr is less than the length of the available data, Fetch or GetData truncates the data and returns SQL_SUCCESS. If dwAttr is 0 (the default), the driver attempts to return all available data. If the specified length is less than the minimum amount of data that the data source can return or greater than the maximum amount of data that the data source can return, the driver substitutes that value and returns SQLSTATE 01S02 (Option value changed). The value of this attribute can be set on an open cursor; however, the setting might not take effect immediately, in which case the driver will return SQLSTATE 01S02 (Option value changed) and reset the attribute to its original value. This attribute is intended to reduce network traffic and should be supported only when the data source (as opposed to the driver) in a multiple-tier driver can implement it. This mechanism should not be used by applications to truncate data; to truncate data received, an application should specify the maximum buffer length in the BufferLength argument in BindCol or GetData.

Reference

  • Include file CODBCStmt.inc
  • Defined in AfxNova/COdbcStmt.inc:1685
  • Documented in Databases/ODBC Classes/CODBCStmt Class.md
  • Topic: CODBCStmt Class