bcrotaz
asked on
Multi-User networked DB
I have an app, using data modules for all tables, which needs multi-user acces to a networked database (Paradox).
I have set the Session.NetFileDir to a globally available directory (with full access privileges) in the initialization section of the first created datamodule.
Why does a Paradox.lck file appear in the database directory, in addition to the paradox.net file in the global access directory?
This means that I can run multiple instances on my computer, but no two computers can simultaneously use the software.
Any ideas?
Bryan
I have set the Session.NetFileDir to a globally available directory (with full access privileges) in the initialization section of the first created datamodule.
Why does a Paradox.lck file appear in the database directory, in addition to the paradox.net file in the global access directory?
This means that I can run multiple instances on my computer, but no two computers can simultaneously use the software.
Any ideas?
Bryan
There is a second variable in the TSession call PrivateDir setting this to, say the local TEMP dir will create the lck file locally.
ASKER
I'll try it...
ASKER
Nope.
Doesn't work.
It still puts the paradox.lck and pdoxusrs.lck files in the alias directory.
Here's the code I'm using to set the Session up:
initialization
GetMem(TempPath,255);
Session.NetFileDir:='g:\pr ojects';
GetTempPath(255,TempPath);
Session.PrivateDir:=TempPa th;
FreeMem(TempPath,255);
end.
That happens in the first datamodule to be created.
The Create constructor for this datamodule is:
procedure TTapeData.TapeDataCreate(S ender: TObject);
var
i: Integer;
begin
for i:=0 to ComponentCount-1 do
if Components[i] is TTable then
(Components[i] as TTable).Open;
end;
This should only open the tables once the session is set up.
If I put a breakpoint in each datamodule at the start of the constructor code, the Session properties are correct. ie. the initialization code is working.
HELLLLPPPPPP!!!
Doesn't work.
It still puts the paradox.lck and pdoxusrs.lck files in the alias directory.
Here's the code I'm using to set the Session up:
initialization
GetMem(TempPath,255);
Session.NetFileDir:='g:\pr
GetTempPath(255,TempPath);
Session.PrivateDir:=TempPa
FreeMem(TempPath,255);
end.
That happens in the first datamodule to be created.
The Create constructor for this datamodule is:
procedure TTapeData.TapeDataCreate(S
var
i: Integer;
begin
for i:=0 to ComponentCount-1 do
if Components[i] is TTable then
(Components[i] as TTable).Open;
end;
This should only open the tables once the session is set up.
If I put a breakpoint in each datamodule at the start of the constructor code, the Session properties are correct. ie. the initialization code is working.
HELLLLPPPPPP!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'll try that.
I've been using another directory, but it's the same path on all machines.
I've been using another directory, but it's the same path on all machines.
ASKER
Actually you were both right....
I was using an old version of my installer by mistake.
20 lashes for me then!
I was using an old version of my installer by mistake.
20 lashes for me then!