Hi,
the code listed here works fine, and makes the connection to the mdb file.
Whenever I try to connect to an Access 2010 accdb-filetype, it fails.
How to solve this?
the code listed here works fine, and makes the connection to the mdb file.
Whenever I try to connect to an Access 2010 accdb-filetype, it fails.
How to solve this?
Code:
Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim connection As OleDbConnection
connection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Alain\Documents\Access Databases\tryout.mdb;")
Try
connection.Open()
MsgBox("Connection Open ! ")
Catch ex As Exception
MsgBox("Can not open connection ! ")
End
End Try
Dim da As New OleDb.OleDbDataAdapter("select * from tabeltoestellen", connection)
Dim ds As New DataSet
da.Fill(ds)
For i = 0 To ds.Tables(0).Rows.Count - 1
CheckedListBox1.Items.Add(ds.Tables(0).Rows(i)(1))
Next i
connection.Close()
End Sub
End Class