BUG: DMO BulkCopy Leaves File Locks When Format File Is Missing

Last reviewed: November 24, 1997
Article ID: Q177207
The information in this article applies to:
  • Microsoft SQL Server version 6.5
BUG #: 1342 (Starfighter65)

SYMPTOMS

When an import or an export is initiated from a SQL-DMO object with a format file specified incorrectly or missing, no data is transferred and the bulk copy error file is left locked until the application which created the BulkCopy object is closed. If the operation is an export, then the data file is created and also left locked.

WORKAROUND

Ensure that the format file is in the correct location before executing the bulk copy operation.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

A Visual Basic application can use SQL-DMO to initiate bulk copy operations. This allows various properties to be set for the BulkCopy object, including the use of a format file and the path to it. If the DataFileType is set to SQLOLEDataFile_UseFormatFile and the format file is not in the path specified by the FormatFilePath property, then all of the following symptoms occur:

  • The bcp log file (specified by the LogFilePath property) contains:

          ::Error::
          Bcp: Unable to open host data-file.
    

    -and-

  • There are no errors returned to the controlling application.

    -and-

  • The file specified by the ErrorFilePath property is left locked until the controlling application is closed.

    -and-

  • If the method used was ExportData, then the data file specified by the DataFilePath property is also left locked until the controlling application is closed.

When the object is created using OLE Automation stored procedures in a Transact SQL batch or a stored procedure, the SQL Server service has to be restarted to release the locks.
Keywords          : kbbug6.50 SSrvGen kbusage
Version           : Windows:6.5
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending kbworkaround


================================================================================


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: November 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.