I am connecting an access database to a datagrid view on vb and I am encountering an error
"Additional information: The 'Microsoft.ACE.OLEDB.12.0Data Source = CUBSDatabase.accdb' provider is not registered on the local machine."
I am using visual studio version 2015, language visual basic. My access database is saved in the bin in the debug folder
This is my code so far; Any idea how to get rid of the error? The error renders on the line // adt.Fill(datatable)
Imports System.Data.OleDb
Public Class Form1
Dim dbconn As New OleDbConnection
Dim adt As New OleDbDataAdapter
Dim ds As New DataSet
Dim datatable As New DataTable
Dim cmd As New OleDbCommand
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
dbconn.ConenctionString = ("Provider=Microsoft.ACE.OLEDB.12.0" &
"Data Source = CUBSDatabase.accdb")
showData()
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
adt = New OleDbDataAdapter("insert into Student (FName, SName, Attendance, CA1, CA2, FinalExam) values ( '" & txtFName.Text & "','" & txtSName.Text & "', '" & txtAttendance.Text & "', '" & txtCA1.Text & "', '" & txtCA2.Text & "', '" & txtFinalExam.Text & "', )", dbconn)
adt.Fill(ds)
ds = New DataSet
MsgBox("Saved")
End Sub
Private Sub showData()
Dim dbcommand As String
dbcommand = "SELECT * FROM Students"
adt = New OleDbDataAdapter(dbcommand, dbconn)
datatable = New DataTable
adt.Fill(datatable)
DataGridView1.DataSource = datatable
End Sub
End Class