SQL Server CE - Internal error: Cannot open the shared memory region

后端 未结 2 2060
面向向阳花
面向向阳花 2021-01-06 01:29

I have a SQL Server CE database that works fine in dev, but when installed on the client has an issue.

  • The SQL Server CE 3.5 dependencies are copied as part
相关标签:
2条回答
  • 2021-01-06 01:56

    You're right that the CE runtime has to be installed. And if you're using VS2010, you have to make sure that you install SP2 of the CE runtimes.

    Even with that installed, I've run into this. In my case, I had a SQL Server CE instance acting as a local cache for a database using ADO.NET Synchronization Services. Is this your scenario?

    I found that on test machines I got this error:

    • If the platform was Vista or Windows 7; and
    • If the SQL Server CE database was installed with the application to
      reside in a protected directory, such as C:\Program Files or C:\Program
      Files (x86); and
    • If the program was run using standard user credentials (i.e. not escalated to Administrator)

    Workarounds for the condition included:

    • Running the application "as Administrator"; or

    • Configuring the application manifest to require Administrator credentials; or

    • Refactoring the application so that the .sdf file was located in an unprotected directory, such as C:\ProgramData[some subdirectory name] and modifying the connection string to point to that area; or

    • Relocating the entire application directory in a user space. For instance, in "Documents" or some similar space with full file access rights to the EXE and the .SDF file

      Obviously, each of those options has its disadvantages.

    0 讨论(0)
  • 2021-01-06 02:02

    I had the same problem.

    Windows 7.

    It was because the user was in a Domain and the permissions where granted to "Everyone" and failed.

    It must be granted to %DOMAIN%/Everyone

    regards

    0 讨论(0)
提交回复
热议问题