title: "Access to the database file is not allowed" from inside IE, but works fine from standalone app
body: <p>I'm building an installation for an ActiveX control.  When I try to use the deployed control in a local, mark-of-the-webbed web page (in IE8 on this VM) it tries to access an SQL CE database, but fails with the above error during the Open() call.  It appears that missing permissions are usually the cause of this error, but granting Full Control to Everyone for the sdf file (and directory) makes no difference.  The connection code is shared by a standalone application deployed alongside it that has no trouble accessing the database.</p>
  
  <p>Running IE as administrator does work, but I don't want to require that of end users.  What's going on?</p>
  
  <p>More Info: According to procmon, iexplore.exe is calling CreateFile() for the sdf file, requesting Generic Read/Write access, using ShareMode Read,Write, with me as the user, and getting ACCESS DENIED as a result.  The error text is</p>
  
  <pre><code>Access to the database file is not allowed. [ File name = c:\mydir\mydb.sdf ]
  
  at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
  at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
  at System.Data.SqlServerCe.SqlCeConnection.Open()
  </code></pre>
  
  <p>Update: The above was using CE 3.5 SP2 (the DLL is .NET 4).  Suspecting that the problem was down to 3.5 not supporting partial trust scenarios, I upgraded to CE 4 SP1, which allegedly does.  But there was no change in behaviour.  Any thoughts?</p>