Solved

The 'Microsoft.Jet.OleDb.4.0' provider is not registered on the local machine.

Posted on 2013-07-01
2
468 Views
Last Modified: 2013-07-02
Good Day:

When I run my web project from the webserver, I am getting the attached error message.
This error occurs when I try to login.

The code on my login button is as follows:

Protected Sub btn_Login_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_Login.Click
        Dim connect As String = "Provider=Microsoft.Jet.OleDb.4.0;" & _
  "Data Source=\\webserver\Payroll\App_Data\otusers.mdb"
        Dim query As String
        query = "Select Count(*) From tblUsers Where Username = ? And UserPassword = ?"
        Dim result As Integer = 0
        Using conn As New OleDbConnection(connect)
            Using cmd As New OleDbCommand(query, conn)
                cmd.Parameters.AddWithValue("", UserName.Text)
                cmd.Parameters.AddWithValue("", Password.Text)
                conn.Open()
                Session("User") = UserName.Text
                result = DirectCast(cmd.ExecuteScalar(), Integer)
            End Using
        End Using
        If result > 0 Then
            Response.Redirect("MainMenu.aspx")
        Else
            Literal1.Text = "Invalid credentials! Please re-enter your username and password and try again."
        End If


    End Sub


However, when I build and run my project on the client's computer all works well.

Please advise
0
Comment
Question by:ernie_shah
2 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 500 total points
Comment Utility
This post says that this is a problem with x64 applications and ODBC. I suppose your client machine is x86 (32 bit) and thus runs your application in 32bit mode. However the server automatically switches to 64 bit mode.

Read the thread but I think the best and first to test advice is this one: "If the issue persist in ASP.NET,All I had to do was change the "Enable 32-bit Applications" setting to True, in the Advanced Settings for the Application Pool."
0
 

Author Comment

by:ernie_shah
Comment Utility
I made the stated change to the application pool for my project and it works like a charm.

Many thanks.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now