打开Paradox数据库; 'PDOXUSRS.NET'解决方法? [英] Opening Paradox database; 'PDOXUSRS.NET' workaround?
问题描述
我正在编写一个应用程序,该应用程序必须打开由第三方保存的预先存在的BDE数据库.
I'm writing an application that has to open a preexisting BDE database that has been saved by a third party.
在此应用程序中,我目前有一个TDatabase
(DriverName
:STANDARD
),其中在Params
中正确设置了path
.
现在,我可以将Connected
设置为true,而不会出现错误消息了.
In this application, I currently have a TDatabase
(DriverName
: STANDARD
) with path
set correctly in Params
.
I can now set Connected
to true without an error message.
还有一个TTable
,其中DatabaseName
设置为TDatabase的值,而TableName
设置为该文件夹中的.db文件(名称是自动填写的,我只想选择它).
There is also a TTable
with DatabaseName
set to the values of the TDatabase and TableName
set to the .db-file that lies in the folder (the name was automatically filled in, I only hat to select it).
现在出现问题:
如果将Active
设置为true,则会出现一条错误消息,提示您缺少对C:\PDOXUSRS.NET
的访问权限.
我知道我可以使用BDEADMIN
设置其他路径,但是我需要在应用程序中解决此问题-我不能指望每个客户都进行此更改.
此外,我有一台运行第三方应用程序的测试机-它可以访问数据库而不会出现任何错误,而我的应用程序会抛出上述错误.这使我怀疑可能存在解决方法.
Now the problem:
If I set Active
to true, an error message complains about missing access rights for C:\PDOXUSRS.NET
.
I know I could set another path using BDEADMIN
, but I need to solve this in my application - I can't expect every customer to do this change.
Furthermore, I have a test machine with the third party application running - it can access the database without any error, while my application throws the aforementioned error. This leads me to the suspicion there might be a workaround.
有这样的解决方法吗?
我只需要对数据库的读取权限.
Is there such a workaround?
I only need read access to the database.
推荐答案
由于链接笨蛋
非常感谢你.
Solved it thanks to the link of bummi
Thank you very much.
报价:
如何以编程方式更改NET DIR,使其持久存在
[...]
您还应该记住,如果您的程序在运行时使用DbiSetProp函数或TSession组件的NetFileDir属性更改其自己的NET DIR位置,则它将覆盖配置文件中的NET DIR值.
How to change NET DIR programmatically so it persists
[...]
You should also remember that if you have programs that change their own NET DIR locations at runtime, using either the DbiSetProp function or the NetFileDir property of a TSession component, this will override the NET DIR value in the configuration file.
它向我指出了更改代码中的NET DIR的可能性:
It pointed me to the possibility of changing the NET DIR in code:
Session.NetFileDir := MyCustomTempDir;
完成此操作后,Table1.active := true
起作用,并且数据显示在连接的TDBGrid
中.
After doing that, Table1.active := true
works and the data shows up in a connected TDBGrid
.
这篇关于打开Paradox数据库; 'PDOXUSRS.NET'解决方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!