如何在Windows 10上写入Access数据库 [英] How to write to an Access database on Windows 10

查看:272
本文介绍了如何在Windows 10上写入Access数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为jdbc odbc桥不再可用(请参阅 UCanAccess ,该功能非常适合阅读数据库,但在Windows 10上,在尝试写入时抛出错误:([CONCURRENT_PROCESS_ACCESS] - File marked as read only. Notice that only one process (one VM) for time can access in writing mode.).

Because the jdbc odbc bridge is no longer available (see this question/answer), I tried UCanAccess, which works great reading the database, but on Windows 10, throws an error on a write attempt: ([CONCURRENT_PROCESS_ACCESS] - File marked as read only. Notice that only one process (one VM) for time can access in writing mode.).

在Windows 8.1和Windows 7上使用UCanAccess驱动程序可以完全相同地读取和写入相同的代码.

The same code reads and writes perfectly using the UCanAccess driver on Windows 8.1 and Windows 7.

由于我没有Windows 10系统,因此我目前无法修改;测试是由高级用户在单个Windows 10安装上执行的.用户可以完全访问有问题的mdb文件.测试了mdb文件的几个路径位置(c:\ProgramDataDownloads),结果相同:读取正常,写入失败.

I am currently unable to tinker since I don't have a Windows 10 system; the tests were performed by a power user on a single Windows 10 install. The mdb file in question was fully accessible by the user. Several path locations for the mdb file were tested (c:\ProgramData, Downloads) with the same result: reads fine, writes fail.

如果任何Windows 10用户想要在各种目录中以及可能需要操纵权限的情况下对其进行测试,那就太好了.

If any Windows 10 user wants to test this for themselves in various directories and possibly manipulating permissions, that would be great.

这里是指向我正在使用的mdb文件的链接.这是测试程序(作为exe).这是源代码的链接.

Here is a link to the mdb file I'm using. Here is a link to the test program (as an exe). Here is a link to the source code.

测试过程将是放置mdb文件,然后使用路径的参数运行测试程序.因此,在Windows命令提示符下,类似:

The test process would be to place the mdb file, then run the test program with the parameter of the path. So at a Windows command prompt, something like:

TestDbAccess c:\my\dir

在其中放置cdb的位置是c:\my\dir.

Where c:\my\dir is where you put the mdb file.

更新:我应该在最初的问题中提到,需要在实际硬件上运行而不是在VBox中虚拟化运行.

UPDATE: I should have included in the original question that running on actual hardware is what is desired, as opposed to running virtualized in VBox.

UPDATE2:错误警报: 根据文件的字节20,该mdb文件实际上是 "Access 97"级别.问题是,负责创建mdb文件的组件有时以某种方式将其创建为"Access 2000",而在其他时候将其创建为"Access 97".确切的发生方式仍然是一个谜,但是它似乎并不依赖于底层的操作系统版本.我对遇到CONCURRENT_PROCESS_ACCESS错误的任何人的建议:相信它!

UPDATE2: FALSE ALARM: The mdb file in question really was "Access 97" level, based on byte 20 of the file. The problem was that the component that had the task of creating the mdb file somehow created it as "Access 2000" sometimes and "Access 97" at other times. Exactly how that happened still remains a mystery, but it does not appear to depend on the underlying OS version. My advice to anyone who runs into the CONCURRENT_PROCESS_ACCESS error: believe it!

推荐答案

UCanAccess和Jackcess本身对Windows 10 没有问题.我只是用UCanAccess运行此SQL语句...

UCanAccess and Jackcess do not have a problem with Windows 10 per se. I just used UCanAccess to run this SQL statement ...

UPDATE CW_EPG_CAPTURES SET title = 'Win10 test'

...在VirtualBox虚拟机上针对您的示例数据库(cw_record.mdb,它为Access 2000格式)

... against your sample database (cw_record.mdb, which is in Access 2000 format) on a VirtualBox virtual machine with

  • Windows 10 Pro技术预览版,内部版本10041(64位)
  • JDK 7u45(64位)
  • NetBeans 7.4
  • UCanAccess 2.0.9.4

它成功执行了更新,没有任何投诉.

and it successfully performed the update without complaint.

.mdb文件是直接从问题链接下载的,并保存到

The .mdb file was downloaded directly from the link in your question and saved into

C:\ Users \ Public

C:\Users\Public

更新:

事实证明,该问题与Windows 10无关.问题很简单,就是有时使用Access 97文件进行测试. Jackcess和UCanAccess仅提供对Access  97文件的只读支持.

As it turns out, the problem had nothing to do with Windows 10. The issue was simply that an Access 97 file was sometimes being used for testing. Jackcess and UCanAccess just offer read-only support for Access 97 files.

这篇关于如何在Windows 10上写入Access数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆