Opening/Listing am Access database using SP.Net

Discussion in 'Databases' started by Bruno, Jul 6, 2017.

  1. Hello. When i run the following code:
    <%@ import namespace="" %>
    <Script runat="server">
    Sub page_load
    Dim dbconn as oledbConnection
    Dim dbCMD as oleDbCommand
    Dim dtr as oledbdatareader
    ' Server.MapPath("[relative path to your database]")
    dbConn = New oledbConnection ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" & server.MapPath("/test.mdb"))
    dbCMD = new oleDbCommand ("select * from tblContact",dbconn)
    dtr = dbCMD.executereader()

    response.write ("<li>")
    response.write (dtr(0) & "---" & dtr(1))
    End while
    End Sub

    It returns me the folloiing errors:

    Erro de servidor na aplicação '/'.
    O fornecedor 'Microsoft.Jet.OLEDB.4.0' não está registado no computador local.

    I dont know how to fix it. Can you please help? Thanks. Bruno.

Share This Page