I am trying to connect to a SQL Server Compact edition db (.sdf) from Access 2003. Here's the start of my code:
Const sdfPath = "C:\SSCE\AmphiData.sdf"
Dim pConn as ADODB.Connection
Set pConn = new ADODB.Connection
pConn.ConnectionString = "PROVIDER=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source = " & sdfPath
pConn.Open
The Open command fails with error: Method 'Open' of object '_Connection' failed.
The path to the .sdf file is correct; I don't have SSCE installed on this computer but I did register the file "SQLCEOLEDB35.dll". Before I registered the dll I got a 'Provider not found' error, so I assume that I got the right dll.
I'm not sure how to proceed from here - does anyone have a suggestion?
Later note - problem kind of solved: The code started working after I did a full install of SSCE. There is at least one more .dll involved. I didn't do the full install at first because I wanted to keep the installation of the Access front end as clean as possible.