简体   繁体   English

为什么我不能从64位Windows 7的mdb文件中检索数据?

[英]Why can't I retrieve data from an mdb file in Windows 7 64-bit?

I recently bought a software that uses an mdb file for data storage. 我最近购买了一个使用mdb文件进行数据存储的软件。 I don't like the software's reporting and statement generation that much so I decided to write my own reporting program using VS 2008's C#. 我不太喜欢该软件的报告和报表生成功能,因此我决定使用VS 2008的C#编写自己的报告程序。

So my program accesses the mdb file that comes with the software I just bought. 因此,我的程序访问了我刚购买的软件随附的mdb文件。 My dev environment is Windows XP. 我的开发环境是Windows XP。 My deployment environment is Windows 7 64-bit. 我的部署环境是Windows 7 64位。 In my dev machine, I can retrieve records from the mdb file just fine but when I deploy the program to a Windows 7 64-bit machine, it cannot read the records from the mdb file. 在我的开发机中,可以很好地从mdb文件中检索记录,但是当我将该程序部署到Windows 7 64位计算机上时,它无法从mdb文件中读取记录。 No errors are thrown, it just can't get that data. 没有抛出任何错误,只是无法获取该数据。

I also tried installing VS 2012 on the deployment machine (Win 7 64-bit) and imported my VS2008 project there. 我还尝试在部署机器(Win 7 64位)上安装VS 2012,并将我的VS2008项目导入那里。 Same issues, can't get records from that mdb file (again, no errors are thrown). 同样的问题,无法从该mdb文件获取记录(再次,不会引发任何错误)。

Please help? 请帮忙?

edit 1: I just tried backing up the mdb using the purchased software backup utility. 编辑1:我只是尝试使用购买的软件备份实用程序备份mdb。 I can retrieve records from that backed up mdb. 我可以从备份的mdb中检索记录。 I wonder if the software is trying to modify my access to the mdb file. 我想知道软件是否正在尝试修改对mdb文件的访问。

edit 2: I don't think the software is trying to modify my access to the mdb file because when deployed to my xp machine, I can access the mdb file just fine. 编辑2:我不认为该软件试图修改对mdb文件的访问权限,因为当部署到我的xp机器上时,我可以很好地访问mdb文件。

edit 3: I'm beginning to suspect this is a file security feature within Windows 7. 编辑3:我开始怀疑这是Windows 7中的文件安全功能。

edit 4: If I copy the mdb file and access that copied mdb file, it returns 0 rows. 编辑4:如果我复制mdb文件并访问该复制的mdb文件,它将返回0行。 If I back it up using the software's backup utility, it returns the exact rows I expect. 如果我使用该软件的备份实用程序进行备份,它将返回我期望的确切行。

The problem is that you're running up against security features of Windows. 问题是您正在运行Windows的安全功能。

Programs are no longer allowed to change files under the program files directories, unless they run with elevated access. 除非程序以提升的访问权限运行,否则不再允许程序更改程序文件目录下的文件。

What happens is that a feature called Virtual Store kicks in and creates private (for your user) copies of the file somewhere else, under your user profile. 发生的事情是启动了一个名为“ 虚拟存储”的功能,并在用户配置文件下的其他位置创建了文件的私有副本(为您的用户)。

Most likely the software has created an empty database file under the user profile, and is accessing that instead. 该软件很可能在用户配置文件下创建了一个空的数据库文件,并且正在访问该文件。

You can not place writable files in the program files any more, the program needs to be either redesigned or installed somewhere else, like under the user profile where it would have write access. 您不能再将可写文件放在程序文件中,需要重新设计该程序或将其安装在其他位置,例如在具有写访问权的用户配置文件下。

将目标平台设置为“ x86”,而不是“ Any cpu”,以确保您运行的是32位。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用P / Invoke从64位C#应用程序中调用64位C ++ DLL? - How can I use P/Invoke to call a 64-bit C++ DLL from a 64-bit C# Application? 由于与 Windows 的 64 位版本不兼容,从字节数组重新创建的可执行文件无法运行 - Executable file recreated from byte array cannot run due to incompatibility with 64-bit version of Windows 如何快速准确地将 64 位 integer 乘以 C# 中的 64 位小数? - How can I quickly and accurately multiply a 64-bit integer by a 64-bit fraction in C#? 如何从64位应用程序连接到Windows Phone 7 - How to connect to windows phone 7 from a 64-bit application 如何在Internet Explorer 64位中支持浏览器中显示PDF文件 - How can I support in-browser display of a PDF file in Internet Explorer 64-bit 在64位Windows 7上开发的软件能否在32位OS(Windows XP或Windows 7)上运行? - Can software developed on 64-bit Windows 7 run on 32bit OS (Windows XP or Windows 7)? 我可以从 64 位 C# Winforms 应用程序调用 MAPI32.DLL > MAPISendMail 吗? - Can I call MAPI32.DLL > MAPISendMail from a 64-bit C# Winforms application? 在64位计算机上从Excel提取数据 - extract data from Excel on 64-bit machine 64位Windows上的注册表重定向 - Registry redirection on 64-bit Windows 64位Windows上的气球工具提示 - Balloon Tooltips on 64-bit Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM