Converting from DB-Library to ODBC Bulk Copy

Converting a DB-Library bulk copy program to ODBC is easy because the bulk copy functions supported by the Microsoft® SQL Server™ ODBC driver are similar to the DB-Library bulk copy functions, with the following exceptions:


Condition indicated
DB-Library varlen value
ODBC cbData value
Null values supplied 0 -1 (SQL_NULL_DATA)
Variable data supplied -1 -10 (SQL_VARLEN_DATA)
Zero length character or binary string NA 0

In DB-Library, a varlen value of -1 indicates that variable length data is being supplied, which in the ODBC cbData is interpreted to meant that only NULL values are being supplied. Change any DB-Library varlen specifications of -1 to SQL_VARLEN_DATA and any varlen specifications of 0 to SQL_NULL_DATA.

See Also
bcp_colfmt SQLSetConnectAttr
bcp_control Using the bcp Format File
Bulk-Copy Functions  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.