 
 : odbc-connect ( env dsn -- dbc )
    >r alloc-dbc-handle dup r>
-   f swap dup length 1024 temp-string 0 <short> SQL-DRIVER-NOPROMPT
+   f swap dup length 1024 temp-string 0 short <ref> SQL-DRIVER-NOPROMPT
    SQLDriverConnect succeeded? [ "odbc-connect failed" throw ] unless ;
 
 : odbc-disconnect ( dbc -- )

FUNCTION: SQLRETURN SQLGetData ( SQLHSTMT statementHandle, SQLUSMALLINT columnNumber, SQLSMALLINT targetType, SQLPOINTER targetValuePtr, SQLINTEGER bufferLength, SQLINTEGER* strlen_or_indPtr )

: alloc-handle ( type parent -- handle )
  f <void*> [ SQLAllocHandle ] keep swap succeeded? [
    *void*
  ] [
    drop f
  ] if ;

  dup >r
  1024 CHAR: space <string> ascii string>alien dup >r
  1024
  0 short <ref>
  0 short <ref> dup >r
  0 uint <ref> dup >r
  0 short <ref> dup >r
  0 short <ref> dup >r
  SQLDescribeCol succeeded? [
    r> short deref
    r> short deref
    r> uint deref
    r> short deref convert-sql-type
    r> ascii alien>string
    r> <column>
  ] [
