Access to the database file is not allowed. [ File name = ***\DataBase.sdf
2011-10-29 01:00
531 查看
今天,在连接数据库的时候,遇到了一个比较奇怪的问题,而且这个问题 现在出错的原理现在我还是搞不清,但是初步有了一个解决方案。
打开程序的时候,然后很习惯的想把数据打开,这个时候数据打不开 说是:数据源连接已经被打开。
我就很纳闷了,然后想不管它了,就直接运行,坑爹的,报错了。
没有访问权限?我是在我的机器上面呢。
行,没访问权限,那照着它的说法,那就改成有访问权限咯。于是找到放我数据库的文件夹,点击属性(properties),然后找到安全这项(Security)如下:
图一:打开 properties,点击“Edit” 按钮,会弹出图二的图片。
图二:接着点“Add”按钮。
图三:到了这一步 在点击“Advanced” 也就是中午 高级选项。
图四:点击“Find Now” 按钮,会在“Search result”列表中列出所有的用户。[b]选择 “everyone” 然后点击“OK”。这一步是重中之重。[/b]
图五:然后可以在Group or user names里看到我们添加的用户。[b]然后再下面的“Permissions for Everyone” 也就是设置权限里,选择“Full Control”,就OK了,这一步也是很关键的。[/b]
通过上面的设定,就可以访问我们的数据。另外有的时候,这样做还是不行?怎么办呢?那可能是你的数据库文件被设定成了只读,只需要再你的数据库文件上 右键,把
“只读”(read-only)去掉就可以了。
希望对你有点帮助,谢谢 晚安。
打开程序的时候,然后很习惯的想把数据打开,这个时候数据打不开 说是:数据源连接已经被打开。
我就很纳闷了,然后想不管它了,就直接运行,坑爹的,报错了。
没有访问权限?我是在我的机器上面呢。
行,没访问权限,那照着它的说法,那就改成有访问权限咯。于是找到放我数据库的文件夹,点击属性(properties),然后找到安全这项(Security)如下:
图一:打开 properties,点击“Edit” 按钮,会弹出图二的图片。
图二:接着点“Add”按钮。
图三:到了这一步 在点击“Advanced” 也就是中午 高级选项。
图四:点击“Find Now” 按钮,会在“Search result”列表中列出所有的用户。[b]选择 “everyone” 然后点击“OK”。这一步是重中之重。[/b]
图五:然后可以在Group or user names里看到我们添加的用户。[b]然后再下面的“Permissions for Everyone” 也就是设置权限里,选择“Full Control”,就OK了,这一步也是很关键的。[/b]
通过上面的设定,就可以访问我们的数据。另外有的时候,这样做还是不行?怎么办呢?那可能是你的数据库文件被设定成了只读,只需要再你的数据库文件上 右键,把
“只读”(read-only)去掉就可以了。
希望对你有点帮助,谢谢 晚安。
相关文章推荐
- Issue: Server principal is not able to access the database under the current security context
- Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
- SQLBackupAndFTP The server principal "NT AUTHORITY\SYSTEM" is not able to access the database "xxxx"
- ASP.NET – The HTTP verb POST used to access path … is not allowed
- Failed to access the USB subsystem.VirtualBox is not currently allowed to access USB devices...
- PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET Application Tries to Write New EventSource in the Eve
- The server principal "sa" is not able to access the database "xxxx" under the current security context
- fix errors 1088: “Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied” and 1334: “Exception: System.IO.FileLoadException”
- CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\application1\c11b43f6\cf3ec03\rizcntet.dll' . The directory name is invalid.
- The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
- Could not write lines to file/Unable to delete file, Access to the path is denied.
- Shrink VmWare File VMDK——Failed to open the disk. The file specified is not a virtual disk
- Solution to "Could not load file or assembly or one of its dependencies. Access is denied"
- The log scan number (620023:3702:1) passed to log scan in database 'xxxx' is not valid
- 2017.7.10 Package name does not correspond to the file path
- SQL Agent Job 报“Access to the remote server is denied because the current security context is not trusted”
- [.net] 关于CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files… ‘Access is denied.’ 的解决办法
- How to grant access to SQL logins on a standby database when the guest user is disabled in SQL Serve
- Access restriction: The method typeNameToClass(String) from the type ObjectHandler is not accessible due to restriction on required library
- 问题解决:psql: could not connect to server: No such file or directory Is the server running