- STMT_t FAR* pstmt = (STMT_t FAR*)hstmt;
- HPROC hproc;
- RETCODE retcode;
- int sqlstat = en_00000;
-
- if( hstmt == SQL_NULL_HSTMT
- || pstmt->hdbc == SQL_NULL_HDBC )
- {
- return SQL_INVALID_HANDLE;
- }
-
- /* check arguments */
- if( icol == 0 && fDescType != SQL_COLUMN_COUNT )
- {
- sqlstat = en_S1002;
- }
- else if( cbDescMax < 0 )
- {
- sqlstat = en_S1090;
- }
- else if(/* fDescType < SQL_COLATT_OPT_MIN || */ /* turnoff warning */
- ( fDescType > SQL_COLATT_OPT_MAX
- && fDescType < SQL_COLUMN_DRIVER_START ) )
- {
- sqlstat = en_S1091;
- }
-
- if( sqlstat != en_00000 )
- {
- PUSHSQLERR ( pstmt->herr, sqlstat );
-
- return SQL_ERROR;
- }
-
- /* check state */
- if( pstmt->asyn_on == en_NullProc )
- {
- if( pstmt->asyn_on == en_stmt_allocated
- || pstmt->asyn_on >= en_stmt_needdata )
- {
- sqlstat = en_S1010;
- }
- }
- else if( pstmt->asyn_on != en_ColAttributes )
- {
- sqlstat = en_S1010;
- }
-
- if( sqlstat != en_00000 )
- {
- PUSHSQLERR ( pstmt->herr, sqlstat );
-
- return SQL_ERROR;
- }
-
- /* call driver */
- hproc = _iodbcdm_getproc( pstmt->hdbc, en_ColAttributes );
-
- if( hproc == SQL_NULL_HPROC )
- {
- PUSHSQLERR ( pstmt->herr, en_IM001 );
-
- return SQL_ERROR;
- }
-
- CALL_DRIVER ( pstmt->hdbc, retcode, hproc, en_ColAttributes, (
- pstmt->dhstmt,
- icol,
- fDescType,
- rgbDesc,
- cbDescMax,
- pcbDesc,
- pfDesc) )
+ STMT_t FAR* pstmt = (STMT_t FAR*)hstmt;
+ HPROC hproc;
+ RETCODE retcode;
+ int sqlstat = en_00000;
+
+ if( hstmt == SQL_NULL_HSTMT
+ || pstmt->hdbc == SQL_NULL_HDBC )
+ {
+ return SQL_INVALID_HANDLE;
+ }
+
+ /* check arguments */
+ if( icol == 0 && fDescType != SQL_COLUMN_COUNT )
+ {
+ sqlstat = en_S1002;
+ }
+ else if( cbDescMax < 0 )
+ {
+ sqlstat = en_S1090;
+ }
+ else if(/* fDescType < SQL_COLATT_OPT_MIN || */ /* turnoff warning */
+ ( fDescType > SQL_COLATT_OPT_MAX
+ && fDescType < SQL_COLUMN_DRIVER_START ) )
+ {
+ sqlstat = en_S1091;
+ }
+
+ if( sqlstat != en_00000 )
+ {
+ PUSHSQLERR ( pstmt->herr, sqlstat );
+
+ return SQL_ERROR;
+ }
+
+ /* check state */
+ if( pstmt->asyn_on == en_NullProc )
+ {
+ if( pstmt->asyn_on == en_stmt_allocated
+ || pstmt->asyn_on >= en_stmt_needdata )
+ {
+ sqlstat = en_S1010;
+ }
+ }
+ else if( pstmt->asyn_on != en_ColAttributes )
+ {
+ sqlstat = en_S1010;
+ }
+
+ if( sqlstat != en_00000 )
+ {
+ PUSHSQLERR ( pstmt->herr, sqlstat );
+
+ return SQL_ERROR;
+ }
+
+ /* call driver */
+ hproc = _iodbcdm_getproc( pstmt->hdbc, en_ColAttributes );
+
+ if( hproc == SQL_NULL_HPROC )
+ {
+ PUSHSQLERR ( pstmt->herr, en_IM001 );
+
+ return SQL_ERROR;
+ }
+
+ CALL_DRIVER ( pstmt->hdbc, retcode, hproc, en_ColAttributes, (
+ pstmt->dhstmt,
+ icol,
+ fDescType,
+ rgbDesc,
+ cbDescMax,
+ pcbDesc,
+ pfDesc) )