Solved

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

Posted on 2013-07-01
2
471 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
ID: 39291393
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
ID: 39293237
I made the stated change to the application pool for my project and it works like a charm.

Many thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

861 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