Friday, June 12, 2009

Installing & using SQL Server Compact Edition data files

I've been writing a program that uses the SQL Server Compact Edition for data storage.

I configure the program (via the application config file in the set-up project) to access the SQL data file (SDF file) from the programs installation folder.  This all worked without problem on my XP & Vista PCs.

However, when installed on another Vista Laptop, my application was denied access to the SDF file and was unable to run.  This turned out to be because the laptop had UAC turned on.

This page  on stackoverflow has some solutions to this problem.  The simplest of which is to change the application to a "Full Trust" application.  You can do this in Visual Studio 2008 from the application security property page. Just check the "Enable ClickOnce Security Settings" and then select "This is a full trust application".

BTW, I've tested this on Windows 7 with UAC set on its default ("Notify me when programs try to make changes to my computer").

No comments:

Post a Comment