Click here to Skip to main content
15,909,953 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Public Class Form1
    'Dim dbProvider As String = "Provider=Microsoft.ace.oledb.12.0;"
    'Dim dbSource As String = "Data Source=~\bin\Debug\EC_Database_2.accdb"
    'Dim constr As String = dbProvider & dbSource
    Dim conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & System.Environment.CurrentDirectory & "\EC_Database.mdb")
    Dim mstr As String = ""


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try

        
            conn.Open()
            mstr = "Select person_ref from QN_Person_Mast order by person_ref asc"
            Dim sda1 As OleDbDataAdapter = New OleDbDataAdapter(mstr, conn)
            Dim dt1 As DataTable = New DataTable()
            sda1.Fill(dt1)
            If dt1.Rows.Count > 0 Then
                ComboBox1.Items.Clear()
                For i As Integer = 0 To dt1.Rows.Count - 1
                    ComboBox1.Items.Add(dt1.Rows(i)("person_ref"))
                Next
            End If
            conn.Close()

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class


I have kept the access file in bin\debug\....but the error is:

The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
please help me....

[edit]Code block added[/edit]
Posted
Updated 25-May-13 5:29am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900