Shouldn't creating a SessionOnStartup handler with the code
(Session.PrivateDir := 'c:\windows\temp'; ) redirect the Paradox.lck and
Pdoxusrs.lck files created by an executable to the private directory?
Or are .lck files always written to the same directory as the executable
file? If not, how can I have the executable write the .lck files to a
temp directory?
Reason... I would prefer not to give users write rights to the
executable directory....
Any ideas?
Thanks.
Erik
Bill
--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)
Bill,
I must be doing something wrong ... my application creates a Paradox.lck and
a Pdoxusrs.lck file in the .exe directory (j:\staff), a .rem file in the
private directory (c:\windows\temp), and .lck files in the data directory.
For my sanity I also tried the following: I had the network administrator
copy the executable to an empty network directory with 'read' and 'file scan'
rights only. After attempting to run the executable I received the following
EDBEngineError: "Cannot Access Directory. File or directory does not exist.
File: J:\Staff\Pdoxusrs.lck Permission Denied."
Any ideas?
Thanks again,
Erik
BDE will create .lck files in every directory it accesses local tables and in
any private directories you create. From your descripion is sounds like you are
creating a session and setting its private directory. If that is the case the
default session that BDE creates is locating a private directory where the .exe
file resides (this is the defatult). You therefore have two sessions and two
private directories with locks
--
Brian Bushay (TeamB)
Bbu...@NMPLS.com
I created a Session.OnStartup handler in the datamodule code but it did seem to
correct the .lck files in the .exe directory problem. I also tried moving the same
code (Session.PrivateDir := 'c:\windows\temp';) to the DataModule.OnCreate handler,
but no luck. Lastly, I tried placing the code in the first form's OnCreate handler
(Bill mentioned this in another post "Re: A Question about TI2993, TeamB") and that
worked -- no more .lck files in my .exe directory.
Thanks for all the help Brian and Bill,
Erik
P.S. The Delphi4 Developer's Guide mentions the code necessary to change the
default private directory, but does not state where this code belongs. I don't
know if you guys have contact with the technical writers, but it might be a good
thing to add to future documentation. Thanks again!
If you do not have a Tsession component on your form or are not creating one in
your code then I made the wrong diagnosis.
Erik,
I had a similiar problem. I am using Delphi 3. I put my database in a PC and
I installed
my application on other 6 PC that used this share database.
I set Session.NetFileDir := ' g:\db' (it is a mapped directory)
When I startup the client applications, in some PCs the .NET file was created
in
the root diretory (c:\) and in the database directory (g:\db). In some PCs the
application
runned, in others it complained about the another .NET controlling the database.
I noticed that in BDE Administrator, the property NET DIR was set to 'C:'. I
cleared
this. The .NET file was now create in the exe directory and the problem was not
solved.
Finally I set NET DIR to the same directory of Session.NetFileDir (g:\db). It
worked
perfectly! I can't understand why, but it worked. If you know, please, tell me.
Thanks,
Evandro
With the 32-bit BDE, you are best advised to use a UNC name for the
NetDir, such as \\Server\NetDir. The UNC name includes the machine name,
so you know that it's pointing to the correct directory without having
to check each workstation's drive mapping.
Richard