Frequently Asked Questions



   NOTE: Please be sure to download the latest
         TOPAZ for Delphi patches before you read on.
         --------------------------------------------

Q. With what compilers can I use TOPAZ for Delphi?

A. TOPAZ comes as a complete source code. You may compile the same source
   code with the following compilers:
     - Borland Delphi 3 and later for 32 bit Windows (Under Win95, Win98, NT, W2K)
     - Borland C++Builder 3 and later (Under Win95, Win98, NT, W2K)
     - Borland Kylix (Under Linux OS)

-----------------------------------------------------------------------
Q. I experience all types of problems when I moved to a XP client which
   talks to a Novell Server. Everything works in 98, and I have not made
   any changes to the application. One of the most common error is:

        Error # 33 (File lock violation)
        Cannot write to: G:\DEPT\PHARM\APK\PATIENT.@S@ LOGIN

A. This answer comes from Rick Tharp, one of our TOPAZ customers,
    who has done a remarkable job of tracking down the problem.

        Found the answer, it's in this Novell tech doc:
          http://support.novell.com/servlet/tidfinder/2962669:

        Replacement version of NWFS.SYS for the Novell Client 4.83
        for Windows NT/2000/XP. Date: 06-14-2002

        The following issues were resolved:

         Unexpected application failures may occur, related to file
         locking or other file handling problems.

-----------------------------------------------------------------------
Q. I have an application that I recently converted to Topaz from the BDE.
   When I used the BDE, I was able to set the application environment
   options as follows to avoid problems running on computers with Windows
   setup for a foreign language (such as French) which uses a ',' instead
   of a '.' for the decimal point:

     ShortDateFormat:='mm/dd/yyyy';
     LongDateFormat:='mm/dd/yyyy';
     DateSeparator:='/';
     ThousandSeparator:=',';
     DecimalSeparator:='.';

   Topaz appears to ignore my overiding environment values and incorrectly
   reads floating point values out of the database with a comma for the
   decimal point when Windows is setup for a foreign language, resulting
   in an exception.

   What do I need to do to force Topaz to use the period for the decimal
   point instead of the comma regardlass of the language...   real
   datatypes use the period for the decimal regardless of the language
   of the user!

A. TOPAZ reads the environment settings in its initialization code. So if
   your application changes the options TOPAZ will not notice the changes.

   To notify TOPAZ and force it to re-read the DecimalSymbol settings use
   the following code:

     unit MyUnit;

     interface

     uses .... ,ucommon;

     implementation
     . . .

     initialization
        ShortDateFormat:='mm/dd/yyyy';
        . . .
        DecimalSeparator:='.';
        TzReadEnvSettings;
     end.

   You may want to place these calls into your unit's "initialization"
   section as shown above, so that the changes take effect *before* any
   databases are open. Don't try to change environmental settings while
   the databases are open.

   NOTE: TzReadEnvSettings is defined in UCOMMON.PAS unit, so you may
   need to add that unit to your "uses" statement.
-----------------------------------------------------------------------

Q. I installed Topaz 8.0 per the instructions in the readme file. However,
   the SSI component tab does not show up. It worked fine when I loaded
   the demo. Do you have any suggestions?

   The package shows up in Component|Install Packages. It does not show
   up in the component pallette, however.

A. Go to "Component|Install Packages". This will pop up a dialog box
   with a list of design time packages. Make sure that TOPAZ is in the
   list and the check mark in front is checked.

   In Delphi there is a configuration option that lets you hide some of
   the components. Sometimes components may end up in the hidden page
   after installation. The trick is to make them visible. Go to
   "Component|ConfigurePallette", scroll down the left list. Select and
   highlight [All].  Now click on the right list and scroll the list to
   see if any of the components say [Hidden] in the Page column. For
   example, look for "TTzDbf". Highlight the specific hidden component
   and click on the "show" button.
   Repeat.
-----------------------------------------------------------------------

Q. I have an application that takes a few seconds to load. Not so long
   that it needs a splash screen, but long enough that the main window
   takes a while to repaint itself. Is there anything to eliminate
   the delay?

A. This is a common question and it has been discussed many times before.
   This answer comes from Delphi Informant's "Delphi by Design" column:
      This problem is quite common for applications that have several
    auto-created forms or data modules. The main form is the first one
    created, but all of the other forms and data modules must be created
    before the main form receives its WM_PAINT message.
      There is a little trick that can help. In the application's project
    file (DPR), add a call to the main form's Update method right after
    the main for is created. As a result the main form is completely
    painted before the secondary forms and data modules are created.
      Although this fixes the problem it has a small side effect on the
    Delphi IDE. In the Project|Options dialog box only the main form
    appears in the auto-create list. The secondary forms and data modules
    are still auto-created; they just don't show up in the dialog box.
    This is a consequence of adding code between CreateForm statements
    in the DPR file.
-----------------------------------------------------------------------

Q. Our problem:
    We are using dbf-files built with dBase IV. Numeric fields displayed
    in a TTzEdit "lose" the final zero - after the decimal point.

    Example:  Value stored in file is    478.90
              the TTzEdit shows          478,9

              Value stored in file is    478.95
              the TTzEdit shows          478,95

    in a calculation this looks rather funny:

     pos    text    invoice amount
      01    xyz        2477,85
      02    xyz2         478,9
      03    xyz3        125,81
      04    xyz4          1005

   The same effect is using the file(s) in a TzGrid or DBGrid !!!

   How can we solve this problem ???

A. Do this:

   1. Start a new project
   2. Drop an instance of TTzDbf on your form. Specify the DBF file in
      DbfFilename and set Active property to TRUE.
   3. Double click on the TTzDbf icon on your form. This will bring up
      Delphi's field editor. Right click on it and click on add fields
      when the menu shows. Add ALL fields. You'll notice that all the
      fields are listed in the property editor.
   4. Click and highlight the numeric field in question.

   5. Switch to the Object Inspector window. In the object inspector
      window find a property called DisplayFormat and set it to be #0.00.

   6. Now drop an instance of TDataSource and link it to the TTzDbf
      instance. Drop your controls: TDBGrid, TTzGrid, TDBEdit or TTzEdit
      link them to your datasource.

   7. This should take care of the problem... Compile and run you project.

   These steps are not any different if you are using Borland's TTable
   instead of TTzDbf, so there may be some documentation on how to set
   field masks.
-----------------------------------------------------------------------

Q. I've been trying to find a way to modify an existing fields length through
   TOPAZ (I need to bypass the bde) and haven't had much luck.  My example is
   that users have an existing db on their PC, I'm sending them an upgraded
   version of the program, and the ZIP code field needs to be changed from 5
   char to 10.

A. This is easy enough to do. However DBF uses fixed record lengths, and that
   will prevent programmers from simply changing the field length in the DBF
   file header. As a result you'll end up copying the entire database one way
   or the other. Do the following:

   1. Create a new database with the new structure. If this is a one time
      change you may create the new structure using WCreate and send it to
      your clients along with your conversion code. Otherwise you can write
      a piece of code that will create the given structure at run time. In
      this FAQ section you'll also find an easy way of creating DBFs at
      runtime.

   2. Open up the new database and use AppendFrom() and point it to the old
      database file. This will add all the records from the old database
      into the new one.

   3. Now you are ready to switch the databases. Close the databases, rename
      the old one into oldname.BAK and the new one into oldname.DBF

   You are done. If you have a need to modify only one or two DBF files
   simply use the WCreate utility to modify the file structure. Don't spend
   time writing a new app. Behind the scenes WCreate will do the above steps
   for you. You can get WCreate.exe by clicking here.
   You may send the downloaded file to your customers too. The precompiled
   WCREATE.EXE can be freely distributed.
-----------------------------------------------------------------------

Q. Has anyone worked with the 266 error? We have been using an old
   TOPAZ application for years without any problems. The application
   is an old DOS application written using BP 7.0 and it performs
   a routine task: it downloads a database from a remote server via
   a modem line, sorts (indexes) the database, and imports a subset of
   records filtered according to some set conditions. Unfortunately
   the old provider of data is out of business and we had to switch
   to using somebody else. Since the switch we seem to be consistently
   getting this TOPAZ error 266 reindexing the database, or sometimes,
   during the import of data. This is strange, since we have not even
   recompiled the application.

A. Error 266 is defined as BadSize error in TOPAZ. Sometimes this error
   shows up when you build indexes. (Pack will also reindex the database,
   so this error may pop up during Pack operation).

   If this is a consistent error that shows up while indexing a given
   database, then the most likely reason is that the database has an
   ASCII zero in one of the fields. TOPAZ's internal parser works with
   zero terminated (C-type) strings.  If an ASCII zero is in one of the
   key fields the key will seem chopped off and that will cause this
   bad key size error.

   If the database has been created and used by TOPAZ, dBASE, FoxPro,
   or Clipper then ASCII zero will not be in the body of your DBF file: all
   these tools are cautious not to clutter the DBF file with ASCII zeros or
   any other garbage bytes. If a field in a DBF file is empty it is usually
   padded with spaces (ASCII 32 ($20 hex)). However there seem to be a few
   tools out there that do not comply with this rule (or possibly it is an
   occasional errors writing to a DBF file) and some fraction of the DBF
   files end up with ASCII zeros sprinkled all over the database. Different
   database libraries and utilities handle these ZEROs differently. Some of
   them are more tolerant than others, many of them will fail handling these
   ASCII zero symbols. TOPAZ is relatively sensitive to corrupted databases.
   (This may be annoying sometimes, but TOPAZ will generate an error as soon
   as it detects *any* error in the DBF format, before it is too late to
   recover your data).

   ASCII zeros must not occur in the DBF files (except in the DBF header).
   If they do you may want to clean up the database. This can be done
   programmatically or you may simply use the utility that can be
   downloaded by clicking here (151 Kb).
   Please read the README.TXT file in the zip file for more details.

-----------------------------------------------------------------------

Q. Could you please show me the easiest way of creating a database at
   runtime?

   WCREATE sample has all the necessary code for this. It shows the
   generic way of creating databases using TOPAZ's low level CreateDbf()
   function. It also shows how to validate the database field names,
   types etc. at runtime. If you want a quick and dirty way for creating
   databases you may use the following code:

   { When you add fields to your list please REMEMBER that the format
     is very strict: 'fieldname,type,length,decimals'
       fieldname- ten characters long, must be unique name for
                  this database, first character is alpha, all
                  the rest is alphanumeric, no spaces are allowed
       type     - must be 'C','N','F','M', or 'L' (valid dBASE types)
       length   - length of the field
       decimals - number of decimals
   }

   procedure TForm1.Button1Click(Sender: TObject);
   VAR dbf: TTzDbf;
   begin
     dbf := TTzDbf.Create(Application); { create an instance of TTzDbf }
     try
       dbf.DbfFields.Clear;                 { clear the list of fields }
       dbf.DbfFields.Add('name,C,30,0');    { add desired fields }
       dbf.DbfFields.Add('age,N,3,0');
       dbf.DbfFields.Add('amount,N,10,2');

       dbf.DbfFilename := 'c:\junk.dbf';    {specify the database name}

       dbf.Active := TRUE;                  { set active to true }
       dbf.Active := FALSE;  { we are done creating the database }
     finally
       dbf.Free; { do not forget to free the instance }
     end;
   end;
-----------------------------------------------------------------------

Q. I am using a component called GTSizer in my application. This component
   is used to automatically resize application windows and controls for
   different resolution screens. This component seems to have trouble
   resizing TTzEdit components that have "sticky" captions (labels).

A. A fix to this problem is to set the "CaptionPos" property of TTzEdit
   to "cpDetached" after you are done positioning TzEdit on your form
   at design time. The same applies to all TOPAZ components that have
   "sticky" captions (labels).
-----------------------------------------------------------------------

Q. I can't seem to read the special German characters (umlauts) from
   TzDbf Fields. When I type in umlauts into Topaz edit controls, they
   are saved and displayed correctly. But if I want to get strings from
   fields and put them into other non-Topaz controls (like a TLabel),
   the special character places are empty or incorrectly displayed.
   E.g. code like "Label1.Caption := tzDbf1.getCField('field')" displays
   incorrect characters for each umlaut in the label caption. The same
   is true going in the other direction, using SetCField with strings
   containing any umlauts, sets incorrect characters into the field.

A. If your database contains character from the high-bit part of the
   ASCII table (e.g. German text) and you wish to access "raw" data
   using TOPAZ functions GetCField or SetField then you should use
   constructions like:
     Label1.Caption := tzAnsiToOem(customer.GetCField('FIELD')) and
     customer.SetCField('FIELD', tzOemToAnsi(MyTextStr));
   NOTE that if you just use TOPAZ controls (e.g. TTzEdit, TTzMemo, etc.)
   you do not need to explicitly call any character conversion functions.
   TOPAZ will take care of conversion for you.

   NOTE: You do not need to use tzAnsiToOem() if you are using TOPAZ 7.0
   under Delphi 2, 3 or 4. TOPAZ will automatically handle the umlauts
   for you.
-----------------------------------------------------------------------

Q. Can I programmatically select a reduced set of fields to view ?

A. Yes, you can. You can specify all the characteristics of a TTzGrid
   columns at design time (visible columns, colors, fonts, alignment,
   etc). For a runtime example please see WBROWSE.EXE which you may
   download from SSI home page. WBROWSE.EXE uses a dual list to
   dynamically change the order of fields, hide and restore
   fields in a database. You may find the source code for WBROWSE
   in SAMPLES directory.
-----------------------------------------------------------------------

Q. When the grid loses focus, am I still pointing to the current
   record?

A. Yes, you will stay on the same record until you click on any
   of the Navigation buttons: Next, Prev, Top, Bottom, or until
   you point and click on another record in the grid. In a grid
   you may also use your keyboard to change the current record:
   e.g. Up key or Dn key.
-----------------------------------------------------------------------

Q. Can I set relation of one database into several others at the
   same time?

A. Yes, you may set one to many relations using TOPAZ.
-----------------------------------------------------------------------

Q. Does the COPY TO support the DELIMITED form?

A. TOPAZ supports export to comma delimited format. Use CopyToDelimited()
   to save data, and AppendFromDelimited() to go the other way.
   Click here to download an example.
   (see also CopyToSDF() and AppendFromSDF() that work with non-delimited
   ASCII files (Export/Import)).
-----------------------------------------------------------------------

Q. In a grid how do I check whether the record I am about to Post is
   valid or not without losing the results of my editing. For example,
   I would like to validate my data while I am in insert mode.

A. The following code shows how it is done using TTzDbf's DSBeforePost()
   event handler.  I used the database MOVIE.DBF with an index with
   the key "YEAR". If you try to add a year which exists in the
   database you will get an error message.

   procedure TForm3.TzDbf1DSBeforePost(DataSet: TTzDataSet;
                             var OkToProceed: Boolean);
   VAR year: String;
    saveRecNo: LongInt;
   begin
     year := TzDbf1.GetField('YEAR');

   { The following piece of code will reposition the database,
     so we better save and restore the record buffer using
     a pair of calls to Push/PopRecord }
     TzDbf1.PushRecord;
     saveRecNo := TzDbf1.RecNo;
     if TzDbf1.Find(year) then begin
       if (TzDbf1.DataSet.State = dsInsert) OR (saveRecNo <> TzDbf1.RecNo) then
       begin
         ShowMessage('Year '+year+' is already in the database!!!');
         OkToProceed := FALSE;
       end;
     end;
     if (saveRecNo <= TzDbf1.RecCount) then
       TzDbf1.Go(saveRecNo)
     else begin
       TzDbf1.GoBottom;
       TzDbf1.Skip(1);
     end;
     TzDbf1.PopRecord;
   end;

  Under Delphi 3 and later, using TOPAZ 7.0 and later the validation
  routine becomes even shorter (note we do not have DSBeforePost
  in this version):

   procedure TForm1.TzDbf1BeforePost(DataSet: TDataSet);
   VAR saveRecNo: LongInt;
       year: String;
   begin
     { The following piece of code will reposition the database,
       we better save and restore the dataset state using a pair
       of calls to Push/PopState }
     TzDbf1.PushState;
     try
       saveRecNo := TzDbf1.RecNo;
       year := TzDbf1.GetField('Year');
       if TzDbf1.Find(year) then begin
         if (TzDbf1.State = dsInsert) OR
            (saveRecNo <> TzDbf1.RecNo) then
            raise Exception.Create('Year '+year+
                                   ' is already in the database!!!');
       end;
     finally
       TzDbf1.PopState;
     end;
   end;
-----------------------------------------------------------------------

Q. Ever since we switched from Lantastic network to an NT Server based
   network we have been having problems printing from DOS based programs.
   The printing is slow. Basically what happens is that you have
   to wait 1.5 minutes for any print job to come out of the printer.
   This delay does not happen with Windows applications, just DOS
   programs.

A. It is hard to say what exactly is going on, but we can flush the
   printer buffer and tell the print server that the print job is
   complete. This is done by opening and closing the LPT port. In the
   version 7.0 of TOPAZ we added a new procedure to flush the printer
   port called "FlushPrinterPort". You may call this procedure in your
   application when you are done with the print job. Otherwise you may
   set the global boolean FlushPrintDevice to TRUE and FlushPrinterPort
   will get called automatically after each occurance of Set_Print_Off()
   and Eject(). Both FlushPrintDevice and FlushPrinterPort are in TOPAZ
   TZPRINT unit.

   Opening and closing a LPT port causes NT Server console to show
   a message every time you call FlushPrinterPort. Therefore if you
   have an NT server you may want to turn off printer job announcements
   at the NT Server console by selecting "Start|Settings|Printers" and
   then selecting the shared printer and choosing "File|Server
   Properties|Advanced" and then unchecking the "Notify when remote
   documents are printed" check box. In typical (brain-dead) Windows
   fashion, you have to reboot the server to make this change actually
   occur.

   Here is another suggestion for the same problem from one of
   our TOPAZ customers:

   "I was just browsing your web page and read a question
    someone had about slow printing. I have had the same problem with
    dos printing through win95 machines. I have no idea about winNT but
    for win95 here is a fix I found hidden in some documentation.

    Edit System.ini
    after the [386] block of code add or check for the following
    [Network]
    PrintBufTime=1
    [IFSMGR]
    PrintBufTime=1

    by adding these lines to the system.ini file stopped the long wait
    I don't know if it works with WinNT as I have not played with WinNT
    yet but for Win95 it sure helps. I think it only helps dos programs
    running through a Win95 window."
-----------------------------------------------------------------------

Q. I am very happy, because yesterday, while browsing the Internet, I
   found your product TOPAZ for Delphi. It is the product that
   I searched for for several weeks and it works very well.
   But there is a little problem. I must develop a database on CD ROM
   and TOPAZ gives me error if I try to use a read only dbf file.
   How can I solve this problem?

A. There is a simple way for you to use TOPAZ for a CD ROM application.
   TOPAZ has a global word variable called FileModeOverride which is
   normally $FFFF. When your program initializes, and before you open
   any databases, set FileModeOverride to 0 (non-sharable read/only), or
   to $40 (sharable read/only). The best way to do this is to just
   modify your project file (.DPR). Here is an example:

      program Wbrowse;

      uses
        Forms,
        Dbrowse in 'DBROWSE.PAS' {Form1},
        DualList in 'DUALLIST.PAS' {DualListDlg},
        TzCommon;               { ADD THIS TO 'USES' STATEMENT }

      {$R *.RES}

      begin
        FilemodeOverride := 0;  { Files will be open Exclusive ReadOnly }

        Application.CreateForm(TForm1, Form1);
        Application.Run;
      end.

   This sample brings up a good point of using global settings in TOPAZ.
   The DPR file is a very good place for your applications global
   initialization calls (e.g. Century, Epoch, or Date Format settings).

   In the following code the programmer wants to instruct the application
   to use 4 digit years with DD/MM/YYYY (GERMANY) format whatever the
   current Windows settings may be:

      begin
        Set_Date(GERMANY);       <-- added
        Set_Century_On;          <-- added

        Application.CreateForm(TForm1, Form1);
        Application.Run;
      end.

   The method described here will work with all versions of TOPAZ
   and Delphi. However there is an easier way of handling ReadOnly
   files if you are using TOPAZ 7.5 and Delphi 3 or later.
   Click here to download a sample.
-----------------------------------------------------------------------

Q. I run a Topaz application compiled under Delphi 2, and when I attempt to
   open a database file, I get I/O Error 32 (file sharing violation). But the
   file is not already open! What's my problem?

A. You have run into a problem created by Borland's system.dcu file which was
   shipped with the original Delphi 2 product. Download Borland's fix
   for this Delphi 2.0 multi-user bug. By replacing system.dcu in the Delphi
   LIB directory with this update, the problem will be solved. Be sure to
   read the READ.!!! file that comes with this download for any exceptions
   that might affect you.

-----------------------------------------------------------------------

Q. How do I use sets in C++Builder? I am converting the following
   Delphi code to C++Builder and don't seem to be able to make it
   work properly (I get compiler errors):

     SelAttributes.Style := [fsBold];

A. Sets are not native to C, however you can still use Delphi sets
   under C++Builder. To handle this specific case you need two lines:

     SelAttributes->Style.Clear();   // clear the set
     SelAttributes->Style << fsBold; // add a style

   If you need to add a couple of styles (for example
   SelAttributes.Style := [fsBold, fsItalic]), then you would
   use the following code:
     SelAttributes->Style.Clear();     // clear the set
     SelAttributes->Style << fsBold;   // add a style
     SelAttributes->Style << fsItalic; // add another one
   or:
     SelAttributes->Style << fsBold << fsItalic; // combine the two

-----------------------------------------------------------------------

Q. Managed to get TOPAZ loaded into Delphi 5 but can't see the components
   or the SSI palette page. Can you offer any explaination ?

A. Check if TOPAZ package is installed by going to 'Component|InstallPackages'
   of the main menu. TOPAZ should be in the list of design time components.
   See if there is a check mark in front of that item. The check mark means
   that the package is properly installed and active.

   Second, go to "Tools|EnvironmentOptions" of the main menu. Click
   on the "Palette" tab. Scroll down and click on "[All]." Scroll
   down the right side and see if TOPAZ components are in the list
   (they have green/tile color, so they can be easily spotted). If
   they are hidden, you will need to unhide them.

-----------------------------------------------------------------------

Q. I have a primary index on a numeric field, AGE. I have another
   index on a character field, LASTNAME. Is it possible to have it
   sort on AGE, then have it sort on LASTNAME within the AGE sort?
   Or can you only have one sort at a time?

A. You can sort by as many fields as you want given that you do not
   exceed the maximum expression size (100 characters for NDXs, and
   220 for MDX). If the database has two fields in it AGE (numeric, 3)
   and LASTNAME (character, 20) you could sort your database using
   the following expression:

         str(AGE, 3, 0) + LASTNAME

   This will order the database by age groups. Each age group will
   be ordered by the lastname. As you see, since the field types don't
   match we have to use dBASE function STR() to convert the numeric
   field into a character string.

-----------------------------------------------------------------------

Q. EVENT_DT is a date field from my dbase file and DT is a string
   variable.  What is the syntax for set filter? I get an error
   using the following statement:

     dt := '02/28/2001';
     TzDbf1.SetFilterTo('Event_dt <= CTOD(dt)');

A. When it comes to date fields the easiest is to set filters
   using dBASE's DTOS() function:

     TodaysDate := '20010404';  // 04/04/2001

     filterStr := '"'+TodaysDate+''" >= DTOS(EVENT_DT)';

     // filter string will be set to:
     // '"20010404" >=  DTOS(EVENT_DT)'

     TzDbf1.SetFilterTo(filterStr);

-----------------------------------------------------------------------

Q. I have trouble installing TOPAZ 7.0 under Delphi 5.

A. Version of TOPAZ 7.0 (7.01) was released before Delphi 5 even existed,
   so right out of the box you will not be able to install it under
   Delphi 5. The best way to handle this is to upgrade your copy
   of TOPAZ to the most recent version. However you can make TOPAZ 7.0
   compile and work under Delphi 5, if you applied all the necessary
   code patches:

     1. Erase the entire TOPAZD directory from your disk.
     2. Create TOPAZD directory and copy and unzip TOPAZ files
        from your distribution disk for TOPAZ 7.0 (or 7.01).
     3.Check the date stamp on your TOPAZ units. If the date stamp
       is later than 10/14/98 then skip the step 4 and go to Step 5.
     4.Apply patches for 7.0 (you'll need to download fixes700.zip
       from our support page).
     5.Apply patches called DELPHI5.ZIP (you'll need to download
       this file from our support page, it says patches for Delphi 5).
     6.Install TOPAZ under Delphi 5.

-----------------------------------------------------------------------

Q. I don't seem to make heads and tales of Append and AppendRec. Could
   you explain what is the difference between the two?

A. This one may get very confusing...

   In old days TOPAZ used to have Append function of its own identical to
   dBASE function APPEND. When we switched to Delphi, Delphi added its
   own Append, so as a result we ended up renaming TOPAZ's old function
   to be AppendRec. So there are two functions which slightly differ in
   how they are used.

     One is "Append". It is defined in TDataSet and TOPAZ implements it.
   If you use "Append" you would have to "Post" your changes. Post is also
   a method defined in Delphi's TDataSet and it is also implemented in
   TOPAZ, since TOPAZ uses TDataSet class as a framework.
     If you use "Append" you do not need to lock your record. Append simply
   switches the dataset to append/insert mode and clears the record buffer.
   There are no physical changes to the physical database file on the disk.
   With Append you would use code like (just like the BDE code):

             customer.Append;
             customer.SetCField("fld1", lastname);
             customer.SetCField("fld2", firstname);
             customer.Post;

     or, if you prefer to use Delphi style code:

             customer.Append;
             customer.FieldByName("fld1").AsString := lastname;
             customer.FieldByName("fld2").AsString := firstname;
             customer.Post;

     If you use "AppendRec" (this one is identical to dBASE APPEND function)
   you have to Alock the record as you did with older versions of TOPAZ
   or with dBASE. With AppendRec you would use something like:

             customer.SetCField("fld1", lastname);
             customer.SetCField("fld2", firstname);
             if customer.ALock then
               customer.AppendRec;
             customer.Unlock;

     AppendRec physically writes the updated record to the physical
   file. It is a lower level TOPAZ function and requires Alock as
   shown here.

-----------------------------------------------------------------------

Q. I have a copy of Delphi 5 STANDARD Edition. I have installed TOPAZ,
   but every time when I drop a copy of TTzDbf I get a message saying
   something about "software not being licensed".

A. This message is generated by Delphi 5 STANDARD Edition. TOPAZ can
   be installed and used with Delphi 5 Standard. You will
   need the distribution disk (the trial version of TOPAZ cannot
   be used with Delphi 5 STANDARD version).

   Unfortunately Borland really "cleaned up" the STANDARD version of
   Delphi 5 and got rid of TDataSet along with the BDE. TDataSet class
   is not part of the BDE and this class is used as a framework for
   the BDE's TTable component and for any of the third party database
   engines like TOPAZ. Using a common ancestor makes it easy for third
   party developers create components which can see and talk to each other.

   You may still use TOPAZ without this class being there. However this
   will lose some of its functionality.

   In the TOPAZ.INC file you can comment out the following line:
     {$define USE_DBDS}

   This compiler directive instructs TOPAZ not to use Delphi's TDataSet
   class. Commenting this line out will downgrade TOPAZ to the functionality
   of the same TOPAZ used under Delphi 1 and 2. So whenever the
   documentation talks about Delphi 1 and 2 specific issues that
   can be applied to your application even if you are using Delphi 5.
   This is true for samples, for example. You will not be able to use
   Delphi3 (and later) samples, even if you are using Delphi 5. Also
   TOPAZ will not recognize third party data aware components, or
   DBControls. You will still be able to use TOPAZ's data aware controls.

   Even if you make TOPAZ work by recompiling it, you may want to
   consider getting Delphi Pro version at some point. In a long run
   the Professional version of Delphi 5 will save you a lot of time
   and frustration.

-----------------------------------------------------------------------

Q. I've heard that cardiovascular exercise can prolong life. Is this true?

A. Your heart is only good for so many beats, and that's it. Everything
   wears out  eventually. Speeding up your heart will not make you live
   longer; that's like saying you can extend the life of your car
   by driving it faster.  Want to live longer? Take a nap.

-----------------------------------------------------------------------

Return to TOPAZ Support Page