viper5646
Active member
Hi I hope there is some one can help me with this error "The 'Microsoft.Jet.OLEDB.4.0Data Source=C:\DEsign.accdb' provider is not registered on the local machine."
This occurs when it tries to open the DataBase. This the code.
This occurs when it tries to open the DataBase. This the code.
VB.NET:
Public Class MainForm
Private m_cnADONetConnection As New OleDb.OleDbConnection
Private m_daDataAdapter As OleDb.OleDbDataAdapter
Private m_cbCommandBuilder As OleDb.OleDbCommandBuilder
Private m_dtDEsign As New DataTable
Private m_rowPosition As Integer = 0
Private Sub MainForm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
m_cnADONetConnection.Close()
m_cnADONetConnection.Dispose()
End Sub
Private Sub ShowCurrentRecord()
MessageBox.Show(m_dtDEsign.Rows.Count)
If m_dtDEsign.Rows.Count = 0 Then
txtContactName.Text = ""
txtState.Text = ""
Exit Sub
End If
MessageBox.Show(m_dtDEsign.Rows(m_rowPosition)("Order Entry").ToString)
txtContactName.Text = m_dtDEsign.Rows(m_rowPosition)("Order Entry").ToString()
txtState.Text = m_dtDEsign.Rows(m_rowPosition)("Address").ToString()
End Sub
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
m_cnADONetConnection.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0" & "Data Source=C:\DEsign.accdb"
m_cnADONetConnection.Open()
m_daDataAdapter = New OleDb.OleDbDataAdapter("select * From Design", m_cnADONetConnection)
m_cbCommandBuilder = New OleDb.OleDbCommandBuilder(m_daDataAdapter)
m_daDataAdapter.Fill(m_dtDEsign)
Me.ShowCurrentRecord()
End Sub