Access 数据库以只读方式打开
我创建了一个 mdb 数据库并保存了它。
现在我想修改它,但它说它是只读的,所以我无法更改任何内容。
这是一个使用 access 2007 打开的 access 2000 文件。
请问我该如何更改它?
I created an mdb database and saved it.
Now I want to modify it but it says it's ReadOnly so I cannot change anything.
It's an access 2000 file opened with access 2007.
How can I change this please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
造成这种情况的主要原因是当数据库在其他地方打开时。
这可能正如许多其他人已经说过的那样:
最近,我遇到了同样的问题,尽管版本不同,我开始寻找原因。
就我而言,我有一个从数据库查询数据的 Excel 文件。
如果在数据库之前打开 Excel 文件,Access 会出现此错误。
结论:
检查与数据库相关的所有文件/连接。 Excel 中使用的打开的 ODBC 连接或查询(我的情况)会打开 mdb 文件并将其设置为只读。
The main reason for this is when the database is open somewhere else.
This could be as already said by many others:
When recently I had the same problem although different versions, I started to search for the reason.
In my case I had an excel file that queried data from the database.
In case the excel file is opened before the database, access would give this error.
Conclusion:
Check all files/connections related to the database. An open ODBC connection or query used in excel (my case) open the mdb file and will make it readonly.
您只能从 Microsoft Access 打开。
You can open exclusively from Microsoft Access.
在我们的例子中,它发生在共享远程盒子上。解决方案是更改文件权限,以便每个用户对每个 Access 文件都拥有完全权限。
现在已经是21世纪了。这种情况不应该再发生了。难怪微软会通过 Office 365 Power Apps 抛弃 Access。
In our case, it happening on a shared remote box. The solution was to change file permissions so that every user had full permissions to every Access file.
It's the 21st century now. This should not be happening anymore. No wonder Microsoft is leaving behind Access with Office 365 Power Apps.
如果其他人打开了数据库,请要求他们关闭它。如果数据库没有完全关闭(Access 或计算机崩溃),那么您可以尝试压缩并修复文件。
我还注意到,如果文件随时打开或置于只读状态,它可能会像这样“卡住”。因此,请尝试以下操作:
不确定这是一个错误还是一个功能,但我发现它让许多用户感到沮丧。
If someone else has the database open, then ask them to close it. If the database was not closed cleanly (Access or a computer crashed), then you can try to Compact and Repair the file.
I have also noticed that if the file is opened or put in a read-only state at any time, it might get 'stuck' like that. So try this:
Not sure it that's a bug or a feature, but I've seen it frustrate many a user.
另一件需要注意的事情是某人有权读取文件共享,但无法写入目录。将数据库设置为对某人只读是可以的,但如果他们曾经读取过该数据库(包括使用 ODBC 连接),则似乎他们需要对该目录具有写入权限,以便他们可以创建锁定文件。
我遇到过数据库在文件共享上被锁定为只读的情况,因为访问它的用户无法写入该目录。快速解决此问题的唯一方法是致电存储团队,他们可以查看谁拥有该文件并将其踢掉。
Another thing to watch for is when someone has access to READ the fileshare, but cannot WRITE to the directory. It's OK to make the database read-only for someone, but if they ever read it (including using an ODBC connection), it seems like they need to have WRITE permissions for the directory so they can create the lock file.
I've run into situations where the database gets locked read-only on the fileshare because the user who accessed it couldn't write to the directory. The only way to fix that quickly has been a call to the storage team, who can see who has the file and kick them off.
创建一个空文件夹并将 .mdb 文件移动到该文件夹。并尝试从那里打开它。我尝试了这种方法,它对我有用。
Create an empty folder and move the .mdb file to that folder. And try opening it from there. I tried it this way and it worked for me.
在我的电脑上我遇到了同样的问题,这是因为在属性 - >安全性我没有文件的所有权......
on my pc I had the same problem and it was because in properties -> security I didn't have the ownership of the file...
另请检查共享驱动器的访问级别。
如果对共享驱动器的访问是只读的,则文件将以只读格式打开。
alos check the level of access to the shared drive.
if the access to the shared drive is read only the file will open in read only format.
检查是否没有丢失的引用 - 为此,请转到数据库窗口并单击“模块”,然后单击“设计”,然后选择菜单“工具”,然后选择“引用”。或者尝试进行编译并查看它是否完全编译(转到“调试”菜单,然后选择“编译”) - 它可能会告诉您缺少引用,例如 Microsoft Office 11.0 对象库。再次从“工具”菜单中选择“引用”,查看是否勾选了任何引用并说“缺失:”。在某些情况下,您可以从列表中选择不同的版本,如果缺少 11.0,请查找版本 12.0,然后重新编译。这通常对我有用。
Check that there are no missing references - to do this, go to the database window and click on "Modules", then "Design", then select the menu "Tools" and then "References". Or try doing a compile and see if it compiles fully (go to the Debug menu then select Compile) - it might tell you of a missing reference e.g. Microsoft Office 11.0 Object Library. Select References from the Tools menu again and see if any references are ticked and say "MISSING:". In some cases you can select a different version from the list, if 11.0 is missing, look for version 12.0 then recompile. That usually does the trick for me.
就我而言,这是因为它正在备份我的后台进程,该进程在我打开 Access 之前启动。如果备份开始时数据库处于打开状态,通常不会出现问题。
In my case it was because it was being backed up my a background process which started before I opened Access. It isn't normally a problem if it have the database open when the backup starts.
虽然OP是数据库的原始作者,并且可能创建了一个简单的数据模型,但我在更复杂的系统上经历了类似的行为。在我的场景中,主 .mdb 文件位于用户具有读/写访问权限的网络共享位置。 .mdb 文件引用了位于不同网络位置(用户没有适当访问权限)的另一个 .mdb 文件中的表。
对于查看本文以解决类似问题的其他人,请验证链接表路径和访问权限。
要验证链接表...(假设 Access 2010)
管理器 - 如果访问 ODBC(即 Oracle、DB2、MySql、PostGRES 等)源,请验证数据库凭据和驱动程序
While the OP is the original author of the database, and likely created a simple data model, I had experienced a similar behavior on a more complicated system. In my scenario the main .mdb file was on a network share location with read/write access by the user. The .mdb file referenced tables in another .mdb file in a different network location - where the user did not have proper access.
For others viewing this post to solve similar problems, verify the linked tables path and access.
To verify linked tables...(assuming Access 2010)
manager - if accessing ODBC (i.e., Oracle, DB2, MySql, PostGRES, etc.) sources, verify database credentials and drivers