Navigation:  Customizing CopiaFacts >

Using DBF/NDX/CDX Database Files

Previous pageReturn to chapter overviewNext page

The original database support in FaxFacts allowed reading and updating of various external database formats based on dBase standards. The features described in this section are still supported but it is suggested that new applications should use the Extended CopiaFacts Database Support.

The command syntax involves the specification of one of the following sets of file details:

An index file only, to determine whether a specific key is in the index
A datafile name and index file name, for file formats for which the index file only contains data for one key
A data description file name (.DD) and an index tag name, for file formats in which the index file contains data for multiple keys.

These command options are discussed in more detail below.

Index Access Only

When an index file is used on its own, it must be a dBASE-style NDX file. This applies to the commands $validate, $image_password, and $image_update, and to the $caller_id command when no data file is needed. NDX lookup is also used for the DNS files (do not send) and the DNA file (do not answer).

The full pathname of the NDX file must be given in the indexfile command parameter. For example:

$validate @ffbase\partnum.ndx

Single Index File

When the index file format contains only one key, you need to specify the datafile name and the index file name. This applies to the commands $lookup_var, $update_dbf, $append_dbf and $infobox, and to the $caller_id command when a data file is required to provide phone, routing or class information.

CopiaFacts supports only the dBASE-style DBF/NDX file combination when a single-index file is used. The index expression of the NDX file must correspond to the name of a single field in the accompanying DBF file (i.e. the index may not be a more complex expression such as two concatenated field names).

Normally, the full pathname of the DBF file must be given in the datafile command parameter and that of the NDX file must be given in the indexfile command parameter. You may also specify a .DD file in the datafile command parameter, with the same basename (drive, directory, filename parts) as the DBF file, and the name of the single index field as the indexfile command parameter. For example:

$lookup_var VNAME @ID idlist.ndx idlist.dbf name

assigns to variable VNAME the contents of the name field in the IDLIST.DBF record corresponding to the index held in the variable ID. The same result could also be achieved by using the command:

$lookup_var VNAME @ID idcode idlist.dd name

but this assumes that:

you have a file IDLIST.DD containing the single line: NDX=idlist.ndx, and
the name of the index field in IDLIST.NDX is idcode, which also represents a field name in IDLIST.DBF.

Multiple Index File

When the index file format contains multiple one keys, you need to supply and specify a .DD file with the same basename as your DBF data file, and also a 'tagname' representing the name of the index key. This applies to the commands $lookup_var, $update_dbf, $append_dbf and $infobox, and to the $caller_id command when a data file is required to provide phone, routing or class information.

CopiaFacts supports only the FoxPro-style DBF/CDX file combination when a multiple-index file is used. The index expression selected from the CDX file must correspond to the name of a single field in the accompanying DBF file (i.e. the index may not be a more complex expression such as two concatenated field names).

You must specify the full pathname of the .DD file in the datafile command parameter, and this must have the same basename (drive, directory, filename parts) as the DBF file. The name of the single index field is given as the indexfile command parameter. For example:

$lookup_var VNAME @ID idcode idlist.dd name

assuming that (a) you have a file IDLIST.DD containing a single line, for example: FOXCDX=c:\faxfacts\idlist.cdx, and (b) that the name of an index field in IDLIST.CDX is idcode, which also represents a field name in IDLIST.DBF.

Opportunistic Locking

Windows has a feature which can prevent effective record locking on a data file which is shared between multiple computers. This may result in data corruption or data loss. To suppress this, perform the following actions:

Run REGEDIT.EXE on the machine where the files reside, and add (or change) a value, then reboot the machine. The value to change is in:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

  LanmanServer\Parameters

Once you have clicked on each of these keys, right click with the cursor in the right hand pane and the Parameters key highlighted in the left pane. Choose New / DWORD Value and set its name to EnableOplocks. The initial data value should remain as 0. If there is already an EnableOplocks value present, be sure it is set to 0 (instead of adding a new value).

 


Topic url: http://www.copia.com/support/refmanual/index.html?usingdbfndxcdxdatabasefil.htm