In VB 2013 I am accessing a SQLServerCE 3.5 file with the following connection string in app.config:
This has worked great on several computers but now I'm getting an access denied error indicating I don't have permission to access the db. This also happens when running as administrator. The db is in
Public gDatabasePath As String = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\IncentiveEval\"
In the ApplicationEvents Startup I have the following:
If My.Computer.FileSystem.FileExists(gDatabasePath + "RIMSII.sdf") Then
File.SetAttributes(gDatabasePath + "RIMSII.sdf", FileAttributes.Normal)
As a test, I set the permissions to allow full control to all users. This does not make any difference.
The installation package creates the required folders if they don't already exist. So, what have I done wrong and what is best practice in this situation?