Compact Framework - vb.net software install problem ADODB on Win 7
Asked By S. Roy on 02-Mar-11 02:12 PM
Hi,
I've written a tool with
VB.NET 2008 Express Edition on Windows Vista 32bit.
The software uses interop to make ADODB connections.
My problem is:
On Windows XP: install is no problem.
On Windows 7 : Exception: System.Runtime.InteropServices.COMException (0x800A0E7A): Provider cannot be found. It my not be properly installed
at
ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
PLEASE HELP! My release is at danger!
My connection string says:
PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;Persist Security Ino=False;Data Source=c:\test.sdf;SSCE:Database Password=abc
Here is what I am distributing:
my EXE file
Interop.ADODB.dll
Interop.Excel.dll (never mind, I need it too)
sqlceoledb35.dll
sqlcese35.dll
sqlceqp35.dll
sqlceer35DE.dll
I'm registering sqlceoledb35.dll with regsvr32.
I tried to install dotnetfx35 first. But that says: (I'm translating from german): "Has software been properly installed?" along with the answer options
- install with recommended settings
- software has been properly installed.
When i press the first the dotnetfx35 install appears to do nothing.
My registry says concerning dotnet:
.NETFramework
AssemblyFolders
v3.0
v3.5
(...)
v2.0.50727
v3.0
v4.0.30319
Is it a 64 bit problem?
Is my way of distribution (copying sqlce files) the problem?
What can I do?
Thanks
Shoumo
Vic S replied to S. Roy on 02-Mar-11 03:02 PM
On a 64-bit machine you can't just use regsvr32 to register a 32-bit dll you need to especifically call it from its path:
%systemroot%\System32\regsvr32.exe i.e. c:\windows\system32\regsvr32.exe
This is because on a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:
- The 64-bit version is %systemroot%\System32\regsvr32.exe.
- The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.
And the 64-bit is the default.
Since it is Windows 7 I would also recommend to right-click on the cmd and run as administrator to open the command window. There type your %systemroot%\System32\regsvr32.exe and register dll.
S. Roy replied to Vic S on 02-Mar-11 04:25 PM
Didn't work!
I tried:
regsvr32 /u sqlceca35.dll
regsvr32 /u sqlceoledb35.dll
c:\windows\system32\regsvr32 /u sqlceca35.dll
c:\windows\system32\regsvr32 /u sqlceoledb35.dll
c:\windows\SysWoW64\regsvr32 sqlceca35.dll
c:\windows\SysWoW64\regsvr32 sqlceoledb35.dll
No success
Then I tried:
regsvr32 /u sqlceca35.dll
regsvr32 /u sqlceoledb35.dll
c:\windows\system32\regsvr32 /u sqlceca35.dll
c:\windows\system32\regsvr32 /u sqlceoledb35.dll
c:\windows\system32\regsvr32 sqlceca35.dll
c:\windows\system32\regsvr32 sqlceoledb35.dll
No success either!
Any more ideas?
Thanks
Shoumo
Vic S replied to S. Roy on 02-Mar-11 04:37 PM
Excuse this question but I have to ask: is https://www.microsoft.com/sqlserver/2008/en/us/compact.aspx installed on the failing PC? How was it installed?
Also if this is a 32 bit app I would rebuild your app targeting x86 only not all cpus.
Vic S replied to S. Roy on 02-Mar-11 05:02 PM
How are you deploying this app, are you making .net framework 2.0 (x86) and SQL Server Compact 3.5 pre-requisites?
Since your app is supposed to work with both 32 and 64 bit machines the first thing I would do is change its target to be x86 (under compile/Advanced Compile options. What that does is kind of tell the app to look for 'things' under the regular 32bit paths (not exactly but I am trying to put it in simple words) instead of the default which in a 64 bit machine it would be under a completely different path. I would rebuild and redeploy the app and see if that worked.
I would assume the machine has the 32-bit sql compact version installed. Did you also install the SP1 for it? If not follow this link and try installing it (once again since we want this app to be 32-bit download the 32-bit version):
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en
S. Roy replied to Vic S on 02-Mar-11 05:19 PM
I'll try that and reply tomorrow.
It's in the middle of the night in Germany now.
Please stay in touch. I need the help.
Thanks
Shoumo
S. Roy replied to Vic S on 02-Mar-11 06:06 PM
unfortunately i can only select "any cpu" for each configuration on my vista 32bit development machine. No x86 to select.
On the failing win 7 i installed sqlservercompact 32bit according to your link.
Still no luck.
Shoumo
S. Roy replied to Vic S on 03-Mar-11 05:04 AM
Hi,
it finally worked!
Targeting x86 at build time made the difference.
I still have to check, whether it's sufficient to distribute the sqlce* dlls or i have to install SQL Server Compact on the target machine.
But that's details i guess.
Thanks so much for you help!
Shoumo
Vic S replied to S. Roy on 03-Mar-11 09:00 AM
I am glad it worked. I think you wouldn't have to install if you target x86 because the app would then install and register the dlls in the correct place but you would only find out for sure by doing it. If you do, could you post back here your results? =)
S. Roy replied to Vic S on 03-Mar-11 01:37 PM
Here's my final report:
on the windows 7 target machine i unregistered sqlceoledb35.dll.
The result was, that my software produced the very exception, that caused this thread.
Subsequently:
uninstalled sql server compact 3.5 (?).
uninstalled my application (deleted directory in Program files (x86))
re-installed sw from new correctly targeted build.
No extra install sql server compact.
Program ran ok. ADODB connection worked fine.
What i didn't do is format disk and have a new naked win 7 for reproducible conditions.
Summary:
1. build the software targeting x86.
2. distribute sqlce* files along with software
3. register sqlceoledb35.dll using c:\windows\system32\regsvr32 (explicit path to avoid 64bit version!)
Regards
Shoumo