问题
I'm writing an application that has to open a preexisting BDE database that has been saved by a third party.
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.
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).
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.
回答1:
Solved it thanks to the link of bummi
Thank you very much.
Quote:
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.
It pointed me to the possibility of changing the NET DIR in code:
Session.NetFileDir := MyCustomTempDir;
After doing that, Table1.active := true
works and the data shows up in a connected TDBGrid
.
来源:https://stackoverflow.com/questions/16915807/opening-paradox-database-pdoxusrs-net-workaround