0

我知道这是一个在这里重复了很多次的问题,但我已经尝试了所有(几乎)并且没有一个帮助我。这是我的连接字符串。

Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Users\SalikSadruddin\Documents\Working Data\Sharon\01simple.xlsx; Extended Properties="Excel 14.0;HDR=YES"

我也试过这个:

Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Users\SalikSadruddin\Documents\Working Data\Sharon\01simple.xlsx; Extended Properties="Excel 14.0 XML;HDR=YES"

和这个:

Provider=Microsoft.ACE.OLEDB.12.0; Data Source="C:\Users\SalikSadruddin\Documents\Working Data\Sharon\01simple.xlsx"; Extended Properties="Excel 14.0 XML;HDR=YES"

但似乎没有一个工作,我得到同样的错误

could not find installable ISAM

请帮助我们解决这个问题,我无能为力。:(
额外信息:

  • 已经在使用 x86
  • DataSource 来自 OpenFile 对话框
  • 已安装 Access DB 引擎 x86
  • 已安装 MS Office 2010 x86
  • 使用 .NET 固件 3.5
  • Visual Studio 2012 速成版
  • 使用 Windows 8 x64

问候
萨利克·萨德鲁丁·梅拉尼

4

2 回答 2

0

找不到可安装的 ISAM。

导入 System.Data.OleDb

公共类 Form1 Dim con As New OleDb.OleDbConnection Dim da As New OleDb.OleDbDataAdapter

Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
    Me.Close()
End Sub

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
    Me.txtstdID.Text = ""
    Me.txtstdName.Text = ""
    Me.txtstdPhnno.Text = ""
    Me.cmbGender.Text = ""
    Me.txtAddress.Text = ""
    Me.txtstdID.Focus()


End Sub
Private Sub RefreshData()
    If Not con.State = ConnectionState.Open Then
        con.Open()

    End If
    Dim dt As New DataTable
    ' Dim da As OleDb.OleDbDataAdapter ("select * from student")'

    da.fill(dt)
    con.Close()
    'Me.dgvdata.Datasourece = dt'
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

    Dim cmd As New OleDb.OleDbCommand
    If Not con.State = ConnectionState.Open Then
        con.Open()
        cmd.Connection = con
        cmd.CommandText = "insert into student(stdid,stdName,stdPhoneNumber,stdGender,stdAddress) values('" & Me.txtstdID.Text & "','" & Me.txtstdName.Text & "','" & Me.txtstdPhnno.Text & "','" & Me.cmbGender.Text & "','" & Me.txtAddress.Text & "')"
        cmd.ExecuteNonQuery()
        con.Close()
        RefreshData()

    End If

End Sub



Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    con = New OleDb.OleDbConnection
    con = New OleDbconnection("provider=Microsoft.ACE.OLEDB.12.0; Datasoure=C:\Documents and Settings\admin\My Documents\Student Management Sys.accdb")
End Sub

结束类

于 2014-01-22T07:38:58.297 回答
-1

检查此代码:

cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;data source =D:\ODD_2015\Counselling.xlsx;extended properties=excel 12.0;"
cn.Open()
于 2015-07-24T09:33:00.647 回答