• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

ASP.net (VB.net) Reference for Access 2000


I am trying to connect to tan Access 2000 database using the code below but am getting the error
'The Microsoft.Ace.OLEDB.4.0' provider is not registered on the local machine
What refderence should I add here
Imports System.Data
Imports System.Data.OleDb

Public Class _Default
    Inherits System.Web.UI.Page

    Dim oFullPath As String = Environ("userprofile") & "\Desktop\Test.mdb"
    Dim ConnectionString As String = "Provider=Microsoft.ACE.OLEDB.4.0;Data Source=" & oFullPath & ";"

    Dim dbadp As OleDbDataAdapter
    Dim dTable As New DataTable

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Call Fill_GridView1()
    End Sub

    Sub Fill_GridView1()

            Dim sSQL As String

            sSQL = "SELECT * FROM Test"
            Dim connection As New OleDbConnection(ConnectionString)
            dbadp = New OleDbDataAdapter(sSQL, connection)

            Me.GridView1.DataSource = dTable
            'Me.DataGridView1.Columns(0).Width = 0

        Catch ex As Exception
        End Try

    End Sub
End Class

Open in new window

Murray Brown
Murray Brown
1 Solution
Éric MoreauSenior .Net ConsultantCommented:
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks very much
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now