Click here to Skip to main content
15,915,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Well am a newbie in vb any help is highly appreciated thank you in advance
My code below gives me an error i seek to resolve
The 'Microsoft.ACE.OleDb.12.0 data source = c:\trail.accdb' provider is not registered on the local machine.

VB
Imports System.Data.OleDb
Public Class frm_patientrecords
    'making the database connection
    Dim con As New OleDbConnection
    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        con.ConnectionString = "Provider=microsoft.jet.oledb.4.0; data source = C:\trail.accdb"
        con.Open()
        datagridShow()
    End Sub
    'call the grid property and object
    Private Sub datagridShow()
        Dim ds As New DataSet
        Dim dt As New DataTable
        'parse the data set into the table
        ds.Tables.Add(dt)
        Dim da As New OleDbDataAdapter
        da = New OleDbDataAdapter("select * from patients", con)
        da.Fill(dt)
        DataGridView1.DataSource = dt.DefaultView
        con.Close()
    End Sub
End Class
Posted
Updated 1-Jul-12 16:17pm
v2
Comments
[no name] 1-Jul-12 22:18pm    
http://forums.asp.net/t/1348126.aspx
[no name] 1-Jul-12 22:39pm    
Of course your narrative mentions OLEDB.12 and your connection string says OLEDB.4....

1 solution

For version 12.0 you need to install MDAC 2010 at http://www.microsoft.com/en-us/download/details.aspx?id=13255.

This has to be done on the server where you publish your application. You need to install the x86 version if the target machine is 32 bit or the x64 version if the target machine is 64 bit and your application is built with configuration Any CPU

It will resolve this issue.
 
Share this answer
 

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