| title | Using IRow::GetColumns (OLE DB driver) | ||||||
|---|---|---|---|---|---|---|---|
| description | Learn how to use IRow::GetColumns to access all columns in a row in OLE DB Driver for SQL Server. IRow allows forward-only sequential access to columns. | ||||||
| author | David-Engel | ||||||
| ms.author | davidengel | ||||||
| ms.date | 06/14/2018 | ||||||
| ms.service | sql | ||||||
| ms.subservice | connectivity | ||||||
| ms.topic | reference | ||||||
| ms.custom |
|
||||||
| helpviewer_keywords |
|
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics PDW FabricSQLDB]
[!INCLUDEDriver_OLEDB_Download]
The IRow implementation allows forward-only sequential access to the columns. You can either access all the columns in the row with a single call to IRow::GetColumns or call IRow::GetColumns multiple times every time that you access several columns in the row.
The multiple calls to IRow::GetColumns should not overlap. For example, if the first call to IRow::GetColumns retrieves columns 1, 2, and 3, the second call to IRow::GetColumns should call for columns 4, 5, and 6. If later calls to IRow::GetColumns overlap, the status flag (dwstatus field in DBCOLUMNACCESS) is set to DBSTATUS_E_UNAVAILABLE.