BUG: bcp_init() Fails if DBBUFFER Is Set Too Low

Last reviewed: April 29, 1997
Article ID: Q113081

The information in this article applies to:
  • Microsoft SQL Server Programmer's Toolkit, version 4.2
BUG# 9920 (4.2)

SYMPTOMS

A call to the DB-Library (DB-Lib) function bcp_init() fails with no error messages generated.

CAUSE

Bcp_init will fail to process correctly if the DBBUFFER value, set by calling dbsetopt(), was set to a value equal to or less than the number of columns in the table that bcp_init is referencing.

For example, assume you have a table defined as:

   CREATE TABLE test (col1 int, col2 int, col3 int)

bcp_init() will fail if the following call to dbsetopt() was made in the application:

   dbsetopt (dbproc, DBBUFFER, "3");

WORKAROUND

This problem can be avoided by either increasing the DBBUFFER value to a value greater than the number of columns, using the example above setting the value to 4 would resolve the problem:

   dbsetopt (dbproc, DBBUFFER, "4");

Another option is to simply not set the DBBUFFER value as it is not used in DB-Library applications that are writing to the BCP API.

STATUS

Microsoft has confirmed this to be a problem in DB-Library version 4.20.00. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: bulk-copy dblib
Keywords : kbbug4.20 kbtool SSrvBCP SSrvDB_Lib SSrvProg
Version : 4.2 | 4.2
Platform : OS/2 WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.