Comments (12)
Could you clarify why you think full access is required?
Do you specify temp paths in your connection string?
from sqlcetoolbox.
I've tried revoke full access for everyone then failed to connect , then grant read and write, failed, grant delete and fail . Finally grant full then ok.
I'm using icacls command
from sqlcetoolbox.
Fail??? What does it mean? Also, you can control access to the folder..
from sqlcetoolbox.
Yes, fail. Using the sqlceconnect and fail.
I could control access to folder, but as the user should access to the file, i can't forbid his access right.
The only solution now is to audit the delete action and to perform regular checking.
However, could i only allow user to read/write/update the sdf but not delete? Of course, user could still read/write/update/delete record in the sdf.
from sqlcetoolbox.
I am trying to help you - but "fail" can mean 1000 different things - could you provide the exact SqlCeException error you are getting, please!
What error do you get if you revoke delete?
from sqlcetoolbox.
The code is not beside me and will revert to you tomorrow. Thanks for your help
from sqlcetoolbox.
Hi ErikEJ, this is quentinw's colleague.
The SqlCeException is captured and below are number of attributes of the Exception object
Message
Access to the database file is not allowed. [ File name = SDF File Path
]
NativeError
25039
StackTrace
at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
at System.Data.SqlServerCe.SqlCeConnection.Open()
Besides, the connection string is as below:-
Data Source=|DataDirectory|SDF File Path
;Password = File Password
We are opening the connection as below:-
SqlCeConnection conn = new SqlCeConnection(ConnectionString)
conn.Open();
then we encountered the above message.
We used the below command to revoke the delete right of the file:-
icacls SDF File Path
/deny Everyone:(D)
Even if we tried to grant (R,W,RX) rights but it still failed to run.
Please help to advise. Thanks for your help.
from sqlcetoolbox.
Do you set the location of DataDirectory in code?
Did you try a full path iso DataDirectory
Did you try to specfiy temp path? https://msdn.microsoft.com/da-dk/library/system.data.sqlserverce.sqlceconnection.connectionstring%28v=vs.100%29.aspx
from sqlcetoolbox.
We didn't set the location of DataDirectory or specify the temp path. The sdf file is placed at a different directory as the program.
from sqlcetoolbox.
What I am suggesting is that you try to do that!
If you use DataDirectory you have no control over the location of the file... Set DataDirectory value in code, or use a full path in your connection string.
from sqlcetoolbox.
We tried taking away the DataDirectory away and also adding temp path to the connection string but it still fails, the same error is occurred. Below is the string we used.
DBConnectionString = "Data Source=C:\TESTDB1\TESTDB.sdf;Password = password;temp path=C:\TESTDB2";
This string will work if the delete privilege is not revoked.
from sqlcetoolbox.
OK, I guess it is not possible then...
from sqlcetoolbox.
Related Issues (20)
- Unable to Open Database file HOT 1
- Information on visual Studio extension, designer auto generated code HOT 1
- VS 2022 dataset specified Type not supported HOT 1
- The specified type is not supported by this selector HOT 2
- Dark toolbar in VS 2022? HOT 5
- Connection error in Server Explorer in Visual Studio 2022 w/SQLite 1.0.118.0 HOT 9
- Tool stop working HOT 4
- Unable to find the requested .Net Framework Data Provider. It may not be installed. HOT 4
- Prep new release with Sqlite 118
- SQL compact toolbox for use on windows ARM HOT 3
- Connection HOT 3
- .NET Core version? HOT 13
- ExportSqlCe40.exe Error Code: 80004005 HOT 3
- i need sqlite and sql server compact toolbox for visual studio 2015 update 3 HOT 2
- i need sql compact server for visual studio 2015 HOT 5
- Visual Studio crashes when using SQLite and SQL Server Compact Toolbox after update HOT 3
- Would it be possible in the future to also read parquet files HOT 3
- 'SQL logic error no such table: TEMP.SCHEMATABLES' when adding Sqlite database entity data model HOT 1
- VSIX Installer stuck! HOT 5
- Scripting API releases? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlcetoolbox.