找不到可安装的 ISAM
我正在使用 vb.net 2003,我想使用 OleDb 连接读取 excel 文件 2003。但是当我将 IMEX=1
属性放在连接字符串上时遇到问题。但是,当我必须删除这个 IMEX
属性时,系统运行时不会出现错误。这是我的连接字符串
xlsCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & " ; Extended Properties=Excel 8.0;IMEX=1")
任何人都可以帮助我解决此错误吗?我需要放置 IMEX 属性,以便它告诉驱动程序始终读取每个单元格上的混合(字符串、整数、日期)数据类型。
这是我遇到的错误。
System.Data.OleDb.OleDbException: Could not find installable ISAM.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Production_Tracking_System.frmPMEFNATUpload.getUploadedData(String pathName) in D:\Legacy\Development\PTS 2 VSG-NAT\Forms\frmPMEFNATUpload.vb:line 434
I'm using vb.net 2003 and I want to read excel file 2003 using OleDb Connection. But I have a problem when I'm putting the IMEX=1
property on the connection String. But when I have to romove this IMEX
property, the system run without an error. Here is my connection string
xlsCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & " ; Extended Properties=Excel 8.0;IMEX=1")
Can any one help me on how could i fix this error? I need to put IMEX property so that it tells the driver to always read intermixed (string, integer, date) data type on each cell.
Here is the error I've encountered.
System.Data.OleDb.OleDbException: Could not find installable ISAM.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Production_Tracking_System.frmPMEFNATUpload.getUploadedData(String pathName) in D:\Legacy\Development\PTS 2 VSG-NAT\Forms\frmPMEFNATUpload.vb:line 434
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果使用超过 1 个扩展属性,则必须用引号引起来的值标记,否则驱动程序无法将它们与连接字符串中的其他非扩展属性区分开来;
If you use more than 1 extended property then the value tokens must be quoted, otherwise there is no way for the driver to distinguish them from the other non-extended properties in the connection string;