in reply to Re^3: SQL CE on Windows 7
in thread SQL Server Compact Edition (SQL CE) on Windows 7 (64bit)

That's one of the connection strings I tried:

DBI Connect('Provider=Microsoft.SQLSERVER.CE.OLDEDB.3.5;Data Source=C: +\temp\MFDB.sdf','',...) failed: Can't Open Connection 'Provider=Micro +soft.SQLSERVER.CE.OLDEDB.3.5;Data Source=C:\temp\MFDB.sdf' Package : DBD::ADO::dr Filename : C:/strawberry/perl/site/lib/DBD/ADO.pm Line : 158 Last error : -2146824582 OLE exception from "ADODB.Connection": Provider cannot be found. It may not be properly installed. Win32::OLE(0.1709) error 0x800a0e7a in METHOD/PROPERTYGET "Open" at test.pl line 7

Comments I read about other providers makes me suspicious that only a 32bit OLEDB provider is available and it doesn't work or isn't available on 64bit Windows 7.

update: I have both 32bit and 64bit versions of SQL Server Compact Edition 3.5 SP2 installed on the system.

update: and the code that produced the above error is:

#!/usr/bin/perl # use strict; use warnings; use DBI; my $dbh = DBI->connect("dbi:ADO:Provider=Microsoft.SQLSERVER.CE.OLDEDB +.3.5;Data Source=C:\\temp\\MFDB.sdf",undef,undef);

Replies are listed 'Best First'.
Re^5: SQL CE on Windows 7
by Corion (Patriarch) on May 28, 2011 at 13:18 UTC
    Provider cannot be found. It may not be properly installed.

    Have you tried the VBA code from Excel and/or Microsoft Access or any other "known good" application? Have you looked at what odbcad32.exe (or the 64-bit variant) and/or whatever method ADO has for listing providers list? Maybe the name is different, or maybe the user account you have does not have the correct permissions to use the provider? What does the manual for SQL Server CE say about connecting to it via ADO? Are you using a 64-bit Perl or a 32-bit Perl?

    Try to eliminate as many variables from the problem. If ADO works, then try to elminate the bitness - check whether connecting via ADO 32-bit works, or whether it is limited to 64-bit ADO, by using 32-bit resp. 64-bit applications. Check that the .sdf file exists and is accessible for the user running your program.