How to connect SQL Server Compact Edition database .sdf file to ADO Connection

434 Views Asked by At

I am trying to use a small .sdf database file created in SQL Server Compact Edition version 4.0 on Delphi application, but I cannot make a connection (ADO Connection) to this database. I have Windows 10 64bit OS, Delphi 10.2

I found tutorial for connection to .sdf file created on 3.5 version on this link: http://slamingcode.blogspot.com/2014/06/connecting-delphi-with-sdf-sql-compact.html

It probably works on .sdf files created on 3.5 version, but when I try to connect "my file", I got error saying that database is created on different version and that I need to install specific DB provider.

So, I installed SQL Server Compact Edition v4.0, but it is only available for 64-bit system. After that, I manage to open and view database through LinqPad application (proof that DB provider was installed and that DB is created in version 4 of SSCE). But, in Delphi, there was no DB provider for SSCE v4.0 on ADO connection in the list.

Based on tutorial for setup 3.5 version in the link above, I found proper (I think) registry key for v4.0 (HKEY_CLASSES_ROOT\WOW6432Node\CLSID{2006C53A-C915-41EA-BAA9-9EAB3A1FBF97}) and added Key "OLE DB Provider" with value "Microsoft SQL Server Compact OLE DB Provider".

Now, I see DB provider in list of providers when I try to make Connection String. But, when I try to use that provider, I got Microsoft Data Link Error:

Provider is no longer available. Ensure that the provider is installed properly

Is it possible to connect Delphi to a .sdf file via ADO connection (or any other) and how?

0

There are 0 best solutions below