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

Help with .NET framework error on clients' computer (Windows Vista/XP)

Hello,

I'm using VS2010 and  included the .NET 4.5 in my setup application, but I'm getting the following error when trying to run the application in my client's computer:

"The microsoft.Jet.OLEDB.4.0 provided is not registered on the local machine"

Any ideas how to fix this problem?

Thanks,

Victor
0
vcharles
Asked:
vcharles
  • 10
  • 7
  • 3
  • +1
1 Solution
 
CodeCruiserCommented:
>included the .NET 4.5
Really?

I guess this computer is 64 bit.

If yes: you need to use the Office Data Connectivity components
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554f536-8c28-4598-9b72-ef94e038c891

If no then
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2deddec4-350e-4cd0-a12a-d7f70a153156
0
 
iHadiCommented:
The problem is most likely that your computer is 64bit. OleDb does not support 64bit applications. Compile your application for x86 (32bit) CPU from VS and it will run without problems.
0
 
Éric MoreauSenior .Net ConsultantCommented:
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
vcharlesAuthor Commented:
Hello,


Can you please send me a few instructions on how to compile 32 bit from Vs 2010.

Thanks,

Victor
0
 
iHadiCommented:
In the Solution Explorer  -> Properties -> Build Tab -> Set the Platform Target to x86, that's it.
0
 
vcharlesAuthor Commented:
Hello,

I can't get to the Build Tab from the properties tab in Solution Explorer. I am using VS 2010. Is there another way to get to the Build tab?

Thanks,

Victor
0
 
iHadiCommented:
Not from the properties tab. In the solution explorer treeview there is a "Properties" node. double click on it and the properties window will be displayed. I'm also using VS2010 and I tried it before I suggested it to you.
0
 
vcharlesAuthor Commented:
When I double click on the properties of solution explorer I see slide 1. However I was able to set the platform target as seen on slide 2 but I still have the same problem. I ran into another issue, not sure if related to this issue. When I run the application in Windows XP all is ok, but when run it in Windows Vista I receive the following error: Operation must use an updateable query.

Details:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.OleDb.OleDbException (0x80004005): Operation must use an updateable query.
   at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
   at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
   at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
   at AOP6VOLII.AOP6V2FRM.updateimage()
   at AOP6VOLII.AOP6V2FRM.AOP6V2FRM_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.225 (RTMGDR.030319-2200)
    CodeBase: file:///F:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AOP6VOLII
    Assembly Version: 1.0.4141.26442
    Win32 Version: 1.0.4141.26442
    CodeBase: file:///F:/Program%20Files/AOP-6(W)VOLII/AOP6VOLII.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
C1.Win.C1TrueDBGrid.2
    Assembly Version: 2.0.20111.61210
    Win32 Version: 2.0.20111.61210
    CodeBase: file:///F:/Program%20Files/AOP-6(W)VOLII/C1.Win.C1TrueDBGrid.2.DLL
----------------------------------------
LarcomAndYoung.Windows.Forms.ReSize
    Assembly Version: 4.1.1130.7807
    Win32 Version: 4.1.1130.7807
    CodeBase: file:///F:/Program%20Files/AOP-6(W)VOLII/LarcomAndYoung.Windows.Forms.ReSize.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///F:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

vs2010.pptx
0
 
iHadiCommented:
You should set the CPU thing for the main project and not just the setup project. Anyway, I think the problem you have experienced is do to file security issue. If you are installing your application on the c: root or program files , ... the application by default doesn't have enough privileges to read or write to the db file. Check the security settings for the db file.
0
 
vcharlesAuthor Commented:
The access file is pasword protected but I never ran into this issue before, what would cause the "Operation must use an updateable query" error message? Previous distributrion was with .NET framework 3.5 could .NET Framework 4.5 be the cause of this error?
0
 
iHadiCommented:
no, it's not about the password, it's about the windows file system security. That means when you press with the right mouse button on the access file file in windows explorer -> properties -> security tab -> allow your user full control on the file.

Or simply move your application folder (with the db) to the d: drive
0
 
vcharlesAuthor Commented:
As an alternative, I would like to access the database from the CD, currently I am accessing the database from the application folder, how would I set the path to access the data from the CD?
0
 
CodeCruiserCommented:
CD is readonly so you would not be able to make any changes in Access file if you open it from CD.

Is your computer 64bit? Where is the Access file located?
0
 
vcharlesAuthor Commented:
I'm sorry for the late response. You're right, I will not be able to use the CD as a data source because users will need to update the database.

I just found out that the error:
System.Data.OleDb.OleDbException (0x80004005): Operation must use an updateable query.

is cause in the following line of code:

 Dim dbcon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\AOP6V2.mdb;Persist Security Info=True;Jet OLEDB:Database Password=testaop")
        dbcon.Open()
        Dim dbcmd As New OleDbCommand
        dbcmd.Connection = dbcon
        dbcmd.CommandText = "Select sn, NID, NID_A, NDI_B, NDI_C, NDI_D, NDI_E, NDI_F From [IMAGE]"
        Dim dbadp As New OleDbDataAdapter(dbcmd)
        Dim dTable As New DataTable
        dbadp.Fill(dTable)
        dbadp.Dispose()
       
For i As Integer = 0 To dTable.Rows.Count - 1
            If IsDBNull(dTable.Rows(i).Item(1)) = False Then
                dbcmd.CommandText = "Update [IMAGE] Set NID='" & Application.StartupPath & "\" & IO.Path.GetFileName(dTable.Rows(i).Item(1)) & "' Where sn='" & dTable.Rows(i).Item(0) & "'"
                dbcmd.ExecuteNonQuery() *****Error***********  
            End If
             If IsDBNull(dTable.Rows(i).Item(2)) = False Then
                dbcmd.CommandText = "Update [IMAGE] Set NID_A='" & Application.StartupPath & "\" & IO.Path.GetFileName(dTable.Rows(i).Item(2)) & "' Where sn='" & dTable.Rows(i).Item(0) & "'"
                dbcmd.ExecuteNonQuery()
            End If
etc....

Apparently it's the code not a security issue. The application is being installed in the F drive, not sure if that is the problem. Any ideas what is wrong with the code?

Thanks,

Victor
0
 
CodeCruiserCommented:
Add a

msgbox dbcmd.CommandText

before the executequery to see what command is being generated. Paste it here
0
 
vcharlesAuthor Commented:
I will test it in the client's pc tomorrow.

Thanks,

Victor
0
 
iHadiCommented:
The place the exception is happening looks like a security issue. Can you add the everyone use to the app_data folder and the db file and set it to full control.
0
 
vcharlesAuthor Commented:
How do I add the eveyone use to the app_data folder and the db and set it to full control?
0
 
iHadiCommented:
click on the file/folder with the right mouse button -> properties -> security tab -> edit button -> add -> enter "everyone" then enter -> select the full control checkbox from the permissions list -> ok button

That's it
0
 
vcharlesAuthor Commented:
Thanks for the comments. It works but when I install the application in Windows Vista the "Everyone" with Full control setting is no longer part of the ACCESS database. I  have to set it again in the client's PC.

Is there a way to avoid the setting from deleting when the application is installed in the client's PC?
0
 
vcharlesAuthor Commented:
Thank You!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 10
  • 7
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now