AISINI 1.0
by
Dana Scott Kaufman
Apogee Information Systems
CompuServe: 75240, 1376
Internet: aisys@ix.netcom.com

Introduction

This component introduces the Paradox concepts of WORK and PRIV aliases to Delphi.  When it is 
dropped on a form, the component creates a WORK and PRIV database.  These Databases can then be 
accessed by the Delphi Dataset components.  Also availible in this component are functions that will return 
the PRIV and WORK paths as strings.  AISINI is also a good example of how to create a component 
editor.  Double clicking on the component will produce a dialog that allows for the changing of the WORK 
and PRIV path.  The Paradox help file describes  the PRIV alias as follows:

In a multiuser environment, you need a place to put your temporary objects. You need to store temporary 
tables, such as Answer or Inserted, in a nonshared directory, or other users could overwrite them. All 
Paradox users need their own private directory when they run Paradox.

The PRIV alias is especially useful with Client/Server development.  This is a good place to store 
temporary result sets from SQL Queries and also modify the results as Paradox tables. 

Installation

Copy the following files to a directory of your choice where the component will be installed from:

AISINI.PAS
AISINI.DCR
DIRNAME.DFM
DIRNAME.PAS

In Delphi:

1. Choose the menu item Options | Install Component ...
2. Click the Add button.
3. Use the browse button and select AISINI.PAS
4.  Hit the Ok button to rebuild the Component palette

The AisIni compoent will now be installed on the Apogee page of the Component palette.

To find the WORK and PRIV path, AisIni will search the WIN.INI file for the Paradox for Windows entry 
and if found use the WORK and PRIV path that resides there.  If  a Paradox section is not found, it then 
searches for a Database Desktop entry.  Sample WIN.INI sections are shown below:

[PDOXWIN]
WORKDIR=C:\APPS\MYWORK
PRIVDIR=C:\TEMP

[DBD]
WORKDIR=C:\PROGRAMS\DBD
PRIVDIR=C:\TEMP

Make sure you add one of these sections to the WIN.INI file of the computers that will run the application 
containing AisIni.


Using AISINI

To use AisIni, select the AisIni component from the palette and drop it on a form.  Now the PRIV and 
WORK database will show up in the Database list of all TTable and TQuery objects used in the project 
containing the AisIni component.

Note:  Only one AisIni component should be used for each project.  The component will check to see if 
other AisIni components exist in the project at create time and will not attempt to create a duplicate PRIV 
and WORK database.

The component also contains to functions GetPrivDir and GetWorkDir.  These functions will return a 
String containing the PRIV or WORK path depending on the call.

function GetPrivDir: String;
function GetWorkDir: String;

Example:

...
var
  PrivatePath:, WorkPath String;
begin
  PrivatePath:=AisIni1.GetPrivDir;
  WorkPath:=AisIni1.GetWorkDir;
end;

Also, double-clicking on the AisIni component on a form at design time will bring up a Component Editor 
that will allow the changing of both the WORK and PRIV path.  The new paths will be written back to the 
WIN.INI file for use by the AisIni component and either Paradox or the DBD depending on what is 
installed.
 

Dana Scott Kaufman
Apogee Information Systems
10 Technology Dr. Suite 1040
Hudson, MA  01749
(508)481-1400
CompuServe: 75240, 1376
Internet: dsktech@ix.netcom.com
