Fandom

Delphi Programming

Use a database on a shared network

2,919pages on
this wiki
Add New Page
Talk0 Share
  • Author: Peter Simon

If you use a database (tables) on a shared network, you can enhance efficiency by setting a number of properties of the TSession component. The TSession component manages a database session.

First of all, Session.PrivateDir should be assigned to a local directory, like C:\WINDOWS\TEMP (you can do this in the OnCreate event of your DataModule, for example). The PrivateDir will contain the result of a local Query (which is a table in itself), and a local table is of course much faster than a table on the network (LAN or otherwise).

Second, Session.NetFileDir should be assigned to the same physical value for every user, like 'X:\BORLAND.COM\BDE' (this also can be done during initialisation).

procedure TForm1.FormCreate(Sender: TObject);
begin
  session.netfiledir:= 'X:\BORLAND.COM\BDE' ;
end;

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki