Page 1 of 1

Compact Edition

Posted: Sun 24 Feb 2008 19:00
by rdevine
I'm trying to evaluate SDAC with SQL Server Compact Edition and dropped a TMSCompactConnection on a form. When I try to connect to an existing sdf file it gives me a message "File already exists. Try a diferent database name".

I get the same message when I try the MSSQLCompact demo (which curiously uses a TMSConnection rather than a TMSCompactConnection). Any idea what I'm missing?

I'm using D6 and Compact Edition 3.1, Provider=MICROSOFT.SQLSERVER.MOBILE.OLEDB.3.0;Data Source="Tracker.sdf"

Thanks, Bob Devine

Posted: Mon 25 Feb 2008 15:50
by Challenger
This can happen because the database has been created using another version of SQL Server CE. To determine the version of your database file use this

Code: Select all

Reading the SDF File
Open the SDF file and read the 4 bytes at offset 0x10 (16). Each version of the SDF has a distinct signature (that looks consistent across all SDF files I've tested):
3.5: 0x9D, 0x7B, 0x35, 0x00
3.0: 0x14, 0xD7, 0x2D, 0x00
2.0: 0x61, 0x62, 0x61, 0x73

Re: Compact Edition

Posted: Tue 26 Feb 2008 10:38
by rdevine
The version numbers look OK. The curious thing is that I can't connect to the sdf file that comes with the demo either, and I'm assuming that was created with the demo.

Further tests show the following:

1. Create test app with TMSCompactConnection and fill connection string with a new file name - the new file is created upon connection.

2. Restart the app and reconnect - works fine.

3. Create another test app with a TMSCompactConnection and copy the connection string from the first test app. Try to connect - "file exists" error!

There seems to be some strange memory effect where you can connect only with the TMSCompactConnection that created the file.

I've also built a Data Abstract driver for TMSCompactConnection and it exhibits the same behaviour.

Thanks, Bob

Posted: Thu 28 Feb 2008 08:31
by Challenger
Please specify the exact version of SDAC you use and whether you have SQL Server CE 3.5 installed.

Compact Edition

Posted: Thu 28 Feb 2008 15:15
by rdevine
I'm using 4.35.0.14 09-Jan-08

Looks like the problem was caused by having v3.1 and v3.5 installed at the same time - I uninstalled v3.5 and it worked fine.

However, if I uninstall both and then reinstall v3.5, I get a "Required provider not installed" message when I try to connect. Tried changing 3.0 to 3.5 in the connection string but no joy. What should the provider be for 3.5?

Thanks, Bob

Posted: Fri 29 Feb 2008 15:04
by Challenger
Similar problem was fixed in SDAC 4.35.1.15.

Compact Edition

Posted: Sun 02 Mar 2008 23:36
by rdevine
I've upgraded to the .15 trial and I still get the "Required provider is not installed" message (only v3.5 is currently installed on my PC. I've also tried manually registering the sqlceoledb35.dll. What settings are you using to get SDAC working with v3.5?

Thanks, Bob

Posted: Thu 06 Mar 2008 10:22
by Antaeus
There is a problem with setting connection string to TMSConnection at design time. We have reproduced the problem and fixed it. This fix will be included in the next SDAC build. Temporarily you should assign connection string to TMSConnection at run time.

Does the problem persist with the TMSCompactConnection component? If it does, in what cases?
When you assign TMSCompactConnection.ConnectionString or when you assign TMSCompactConnection.Options.CompactVersion?