1
我有以下代碼: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
異常文本:CAN-找不到可安裝ISAM。
我在做什麼錯?
請幫忙,我是新手!