Microsoft KB Archive/177207

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

Article ID: 177207

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q177207



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: kbbug kbpending kbusage KB177207

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.