Can't open SQL CE 4.0 on Win7 64 bit (CE 3.5 previously worked fine)

Sep 18, 2013 at 6:49 PM
I had been using the CEQuery for CE 3.5 for a couple of years and it worked fine.
I uninstalled the CEQuery for CE 3.5 and installed CEQuery for CE 4.0 and now it fails to open any CE 4.0 databases.
(I tried copying the dll's as noted in https://cequery.codeplex.com/discussions/287053 but it still fails.)
Any ideas?

The error from the unhandled exception dialog:
System.Data.SqlServerCe.SqlCeException: Possible file version mismatch detected between ADO.NET Provider and native binaries of SQL Server Compact which could result in an incorrect functionality. This could be due to the presence of multiple instances of SQL Server Compact of different versions or due to wrong binaries with same name as SQL Server Compact binaries. Please install SQL Server Compact binaries of matching version.
   at System.Data.SqlServerCe.NativeMethods.IsValidBinary(String filename)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at CEQuery.OpenDB.btnOK_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(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: 2.0.0.0
    Win32 Version: 2.0.50727.4984 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
CEQuery
    Assembly Version: 6.0.0.0
    Win32 Version: 6.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/Mayukh's%20Lab/CEQuery/CEQuery.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4986 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4985 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4985 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data.SqlServerCe
    Assembly Version: 4.0.0.1
    Win32 Version: 4.0.8482.1
    CodeBase: file:///C:/Program%20Files%20(x86)/Mayukh's%20Lab/CEQuery/System.Data.SqlServerCe.DLL
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Coordinator
Oct 27, 2013 at 9:42 PM
Hii Matt,
I am sorry to respond you late. Can you please uninstall all the version of SQL Server CE version from your machine, restart the system and then try to follow the method mentioned in https://cequery.codeplex.com/discussions/287053

Let me know if this resolves the issue.

Thanks
Mayukh
Oct 28, 2013 at 6:06 PM
No luck.
Still fails the same way.
Nov 30, 2013 at 12:47 PM
Edited Nov 30, 2013 at 12:48 PM
Hi All,
the link Ray mentioned was an old thread of mine - where Ray's solution worked fine! NOW:

I'm also having the same problem again in my W8 environment; BUT the procedure which worked in W7 doesn't obviously apply to W8 CE 4.0!

Ray, I sent this issue to you through another codeplex channel, sorry
BUT thanks for your time and any hints
ed k