找不到可安装的isam VB.NET excel 2016 [英] Could not find installable isam VB.NET excel 2016

查看:315
本文介绍了找不到可安装的isam VB.NET excel 2016的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们帮助我。我需要将excel文件导出到datagridview。但每次我选择通过文件对话框打开文件,错误来了,并说可能找不到安装的ISAM请帮助我。使用Microsoft.Jet.OLEDB.4.0而不是Microsoft.ACE.OLEDB.12.0。谢谢



我尝试过:



Guys help me. I need to export the excel file to datagridview. But Everytime i select opened the file via file dialog box, the error was come and says "COULD NOT FIND INSTALLABLE ISAM" Help me please. With using Microsoft.Jet.OLEDB.4.0 not the Microsoft.ACE.OLEDB.12.0. Thanks

What I have tried:

Dim OpenFileDialog1 As New OpenFileDialog()
       Dim constr As String
       'Dim con As OleDb.OleDbConnection
       Dim con As OleDbConnection

       Try

           OpenFileDialog1.Filter = "Excel Files | *.xlsx; *.xls; *.xlsm;"

           If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
               Me.txtOpen.Text = OpenFileDialog1.FileName

               constr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" + txtOpen.Text + ";Extended Properties = Excel 8.0;HDR=Yes;IMEX=1"
               'constr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + txtOpen.Text + ";Excel 12.0 Xml;HDR=YES"
               con = New OleDbConnection(constr)
               con.Open()

               cboSheet.DataSource = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
               cboSheet.DisplayMember = "TABLE_NAME"
               cboSheet.ValueMember = "TABLE_NAME"
           End If
       Catch ex As Exception
           MessageBox.Show(ex.Message)
       End Try

推荐答案

您必须确保已安装Jet驱动程序。但这仅适用于32位版本。因此,您的应用程序必须构建为32位(目标平台x86而不是任何CPU)。



如果可能,请使用ACE驱动程序,因为Jet已被弃用多年。
You have to ensure that the Jet driver is installed. But that is only available as 32-bit version. So your application must be build as 32-bit (target platform x86 and not Any CPU).

If possible use the ACE driver instead because Jet is deprecated since many years.


您不能在 .xlsx Microsoft.Jet.OLEDB.4.0 $ c>文件。您必须使用 Microsoft.ACE.OLEDB.12

请参阅: Excel连接字符串 - ConnectionStrings.com [ ^ ]



要解决您的问题,请查看: Jet for Access,Excel和Txt在64位系统上 - ConnectionStrings.com [ ^ ]



详情请见: HOW TO:FIX ERROR - 'microsoft.ace.oledb.12.0'提供程序未在本地计算机上注册 [ ^ ]
You can't use Microsoft.Jet.OLEDB.4.0 within .xlsx files. You have to use Microsoft.ACE.OLEDB.12 instead.
See: Excel connection strings - ConnectionStrings.com[^]

To resolve your issue, check this: Jet for Access, Excel and Txt on 64 bit systems - ConnectionStrings.com[^]

For further details, please see: HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"[^]


谢谢! :) .................
Thank you! :) .................


这篇关于找不到可安装的isam VB.NET excel 2016的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆