FIX: "Run-Time Error" Occurs with ExportData Method of BulkCopy Object When DataBase Name Contains Space (817848)
The information in this article applies to:
- Microsoft Data Access Components 2.7 SP1
- Microsoft SQL Server 2000 (all editions) SP3
SYMPTOMSWhen you use the ExportData method of the BulkCopy object from SQL Distributed Management Objects (SQL-DMO), and the
name of the database that you use in the method contains a space (for example, My Database), you receive the following error message at run time:
Run-time error '-2147221348(8004009c)':
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the
keyword 'Database'. [Microsoft][ODBC SQL Server Driver][SQL
Server]Incorrect syntax near the keyword 'Database'.
RESOLUTIONTo resolve this problem download MDAC 2.7 Service Pack 1 (SP1) Refresh. To download MDAC 2.7 SP1 Refresh, visit the following Microsoft Web site: WORKAROUNDTo work around this problem, remove the space in the name of
the database. To do this, you can name the database as follows:
- Execute the following SQL command in SQL Query Analyzer.
sp_renamedb 'My Database', 'MyDatabase' - Modify the name of the database in the Visual Basic
project.
- On the Run menu, click
Start.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
This bug was corrected in MDAC 2.7 Service Pack 1 Refresh.
REFERENCES For additional information, click the following
article number to view the article in the Microsoft Knowledge Base: 299865
FIX: DMO BulkCopy Fails to Copy Data When Column Names Contain the Space Character
| Modification Type: | Major | Last Reviewed: | 12/3/2003 |
|---|
| Keywords: | kberrmsg kbSqlClient kbExport kbDatabase kbbug KB817848 kbAudDeveloper |
|---|
|