Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.3 KB

data-buffer-address.md

File metadata and controls

26 lines (23 loc) · 1.3 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Data Buffer Address
Data Buffer Address
David-Engel
v-davidengel
01/19/2017
sql
connectivity
conceptual
address of data buffers [ODBC]
buffers [ODBC], data
data buffers [ODBC], address

Data Buffer Address

The application passes the address of the data buffer to the driver in an argument, often named ValuePtr or a similar name. For example, in the following call to SQLBindCol, the application specifies the address of the Date variable:

SQL_DATE_STRUCT Date;  
SQLINTEGER DateInd;  
SQLBindCol(hstmt, 1, SQL_C_TYPE_DATE, &dsDate, 0, &DateInd);  

As mentioned in the Allocating and Freeing Buffers section, the address of a deferred buffer must remain valid until the buffer is unbound.

Unless it is specifically prohibited, the address of a data buffer can be a null pointer. For buffers used to send data to the driver, this causes the driver to ignore the information normally contained in the buffer. For buffers used to retrieve data from the driver, this causes the driver to not return a value. In both cases, the driver ignores the corresponding data buffer length argument.