OleDB 异常:找不到可安装的 ISAM 异常,出了什么问题?
我有以下代码:
Imports System.Data.OleDb
Private Sub getData()
Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\rawData.xlsx;Extended Properties=Excel 12.0 Xml;"
Dim oleConn As New OleDbConnection(connStr)
Dim query As String = "SELECT * FROM [Sheet1$]"
Dim cmd As New OleDbCommand(query, oleConn)
Dim reader As OleDbDataReader
oleConn.Open() ' Getting Exception Here !!
reader = cmd.ExecuteReader()
Do While reader.Read()
InputOutput.print(reader.GetString(0)) ' Prints the 1st column.
Loop
reader.Close()
oleConn.Close()
End Sub
异常文本:找不到可安装的 ISAM。
我做错了什么?
请帮忙,我是新手!
I have the following code :
Imports System.Data.OleDb
Private Sub getData()
Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\rawData.xlsx;Extended Properties=Excel 12.0 Xml;"
Dim oleConn As New OleDbConnection(connStr)
Dim query As String = "SELECT * FROM [Sheet1$]"
Dim cmd As New OleDbCommand(query, oleConn)
Dim reader As OleDbDataReader
oleConn.Open() ' Getting Exception Here !!
reader = cmd.ExecuteReader()
Do While reader.Read()
InputOutput.print(reader.GetString(0)) ' Prints the 1st column.
Loop
reader.Close()
oleConn.Close()
End Sub
Exception Text : Can-not find installable ISAM.
What am I doing wrong ?
Please help, I am a newbie !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将我的连接字符串更改为:
它就像一个魅力..!
Changed my connection string to :
And it worked like a charm.. !
检查这段代码,它工作正常。
Check with this code, its working fine.