Oledb connection string for excel files

怎甘沉沦 提交于 2019-12-11 03:56:42

问题


This is the oledb connection string I'm using while loading excel 2003 files. But I'm getting the error could not find installable ISAM`.' Please help me in this issue. What I'm doing wrong here.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\FileUploadV2\FlatFile
\Book2-17.xls;Extended Properties=Excel 8.0;HDR=NO;

It works fine when I used the same connection string without HDR parameter. But I need to upload the excel without headers.


回答1:


Could you show us the exact connection string with quotation marks? It should read:

Extended Properties="Excel 8.0;HDR=YES"

and full code would be something like:

ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFileName & ";Extended Properties=""Excel 8.0;HDR=YES"";"




回答2:


<connectionStrings>
    <add name="AsstMgmt" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\FOLDER1\FOLDER2\XYZ.mdb; Persist Security Info=False;" providerName="System.Data.OleDb" />
</connectionStrings>


来源:https://stackoverflow.com/questions/5814898/oledb-connection-string-for-excel-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!