VC++ 6.0 应用程序必须以管理员身份运行才能访问公共应用程序数据区域中的数据库
我有一个用 VS 6 编写的旧 C++/MFC 应用程序。我试图通过将 DB 目录移动到通用应用程序数据区域来使其与 Windows Vista 和 7 兼容。但是,当我尝试使用 DAO 打开 Access DB 时,它读取主表,未找到任何记录,并报告未找到数据。但是,如果我选择“以管理员身份运行”,那么我可以毫无问题地访问它。
我应该将数据库存储在其他位置吗?如果不是,为什么不能正确读取表格?
另外,我尝试使用下面列出的清单(我在网上找到的),但它似乎并没有强制应用程序以管理员身份运行,因此我仍然收到“找不到数据”消息。但我对清单还不太了解,所以可能是我没有正确配置它。
感谢您提供的任何帮助或建议。
现场应用程序
I have an old C++/MFC app written with VS 6. I am trying to make it compliant with Windows Vista and 7 by moving the DB directory to the Common Application Data area. But when I try to open the Access DB using DAO it reads the primary table, finds no records, and reports that no data is found. However, if I select "Run as Admin", then I can access it without an issue.
Should I be storing the database in another location? If not, why does it fail to read the table correctly?
Also, I have tried using the manifest listed below, that I found online, but it does not seem to force the application to run as admin and so I still get the no data found message. But I don't know much about manifests yet, so it could be that I didn't configure it correctly.
Thanks for any help or advise you can give.
FieldAppl
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我用来确保我的自定义安装程序以管理员身份运行的清单。除了此清单之外,我还使用 Verisign 证书对应用程序进行了数字签名。
斯科特
Here is the manifest I used to ensure my custom-written installer ran as an administrator. In addition to this manifest, I also digitally signed the application with a Verisign certificate.
Scott
>