Link to home
Start Free TrialLog in
Avatar of bcrotaz
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
Avatar of gdj
gdj

There is a second variable in the TSession call PrivateDir setting this to, say the local TEMP dir will create the lck file locally.
Avatar of bcrotaz

ASKER

I'll try it...
Avatar of bcrotaz

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:\projects';
  GetTempPath(255,TempPath);
  Session.PrivateDir:=TempPath;
  FreeMem(TempPath,255);

end.

That happens in the first datamodule to be created.
The Create constructor for this datamodule is:

procedure TTapeData.TapeDataCreate(Sender: 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!!!
ASKER CERTIFIED SOLUTION
Avatar of jackb022197
jackb022197

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bcrotaz

ASKER

I'll try that.
I've been using another directory, but it's the same path on all machines.
Avatar of bcrotaz

ASKER

Actually you were both right....

I was using an old version of my installer by mistake.

20 lashes for me then!