返回首页

大家好,

请建议如何摆脱错误
"无法找到可安装的ISAM"当我尝试从ASP.NET应用程序连接到一个Excel文档。

我读了它,并evryone说,因为连接字符串,如果我使用jet.4.0和扩展属性被设置为Excel 8.0,它应该工作,但我仍然得到erorr。

代码为:

Protected Function ExcelConnection() As OleDbCommand

    Dim xConnStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = C:\Users\Arnold\Desktop\Annexcelweb\ExcelImport.xlsx;Extended Properties=Excel 8.0;HDR = YES;IMEX = 1"

 

    ' create your excel connection object using the connection string

    Dim objXConn As New OleDbConnection(xConnStr)

    objXConn.Open()

    ' use a SQL Select command to retrieve the data from the Excel Spreadsheet

    ' the "table name" is the name of the worksheet within the spreadsheet

    ' in this case, the worksheet name is "Members" and is expressed as: [Members$]

    Dim objCommand As New OleDbCommand("SELECT * FROM [Sheet1$]", objXConn)

    Return objCommand

请帮助..

谢谢。

回答

评论会员:游客 时间:2012/02/06
苏雷什Suthar:如果您使用比变化提供的MSExcel2007=Microsoft.Jet.OLEDB.4.0Microsoft.ACE.OLEDB.12.0和扩展属性的Excel8.0扩展属性=12.0Excel的连接字符串。更多细节imgsrc=
你可能尝试读取Excel 2007文件(xslx)
尝试使用连接字符串描述的{格A1}

尝试一些像"提供= Microsoft.ACE.OLEDB.12.0; = C:\用户\阿诺德\桌面\ Annexcelweb \ ExcelImport.xlsx;扩展属性数据源的Excel 8.0; HDR = YES,IMEX = 1"
评论会员:。 时间:2012/02/06