BUG: Excel ODBC Driver Disregards the FirstRowHasNames or Header Setting (288343)
The information in this article applies to:
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.1 (GA)
- Microsoft Data Access Components 2.1 SP1
- Microsoft Data Access Components 2.1 SP2
- Microsoft Data Access Components 2.5 SP1
- Microsoft Data Access Components 2.5
This article was previously published under Q288343 SYMPTOMS
When you use the Microsoft Excel Open Database Connectivity (ODBC) Driver to connect to an Excel worksheet as an ODBC data source, the driver assumes by default that the first row of worksheet data contains column headers (field names). According to the driver documentation, the optional FirstRowHasNames connection setting can be used to change this default behavior by using 0 for False and 1 for True. However, in fact, the driver disregards this setting and the first row of data is always treated as column headings. If the first row of data does not contain column headings or other entries, the effective result is that the first row of data "disappears."
CAUSE
The value of the FirstRowHasNames or Header (HDR) parameter is never being passed to the Excel ODBC Driver.
RESOLUTION
The HDR= setting is available and functional when you use the Microsoft Jet OLE DB Provider and its Excel ISAM driver. Therefore, the best solution is to use the Jet Provider rather than the Excel ODBC driver.
Because the Excel ODBC driver always assumes that the first row contains field names, the first row must always contain either valid field names, or dummy entries that the developer is willing to disregard.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCESFor additional information278973, click the article numberSAMPLE: Excel ADO Demonstrates How to Use ADO to Read and Write Data in Excel Workbooks below
to view the articleSAMPLE: Excel ADO Demonstrates How to Use ADO to Read and Write Data in Excel Workbooks in the Microsoft Knowledge Base:
Modification Type: | Major | Last Reviewed: | 9/16/2003 |
---|
Keywords: | kbbug kbMDACNoSweep kbpending KB288343 |
---|
|