Board index » delphi » index out of date

index out of date

Got an index out of date error.
I'm using a dbase file.
Tried to reindex using DbiRegenIndexes function. I still got then same
error.
This is my code

   TABLE1.active:=false;
  try
    TABLE1.exclusive:=true;
    TABLE1.active:=true;
    Error:=DbiRegenIndexes(TABLE1.Handle);
    TABLE1.active:=false;
    TABLE1.exclusive:=false;
  finally
    TABLE1.active:=true;
  end;
  case Error of
    DBIERR_NONE:
      ErrorMsg:='Sucessful';
    DBIERR_INVALIDPARAM:
      ErrorMsg:='The specified table name or the pointer to the table is
NULL';
    DBIERR_INVALIDHNDL:
      ErrorMsg:='The specified database handle or cursor handle is invalid
or NULL';
    DBIERR_NOSUCHTABLE:
      ErrorMsg:='Table name does no exist';
    DBIERR_UNKNOWNTBLTYPE:
      ErrorMsg:='Table Type is unknown';
    DBIERR_NEEDEXCLACCESS:
      ErrorMsg:='The table is not open in exclusive mode';
  else
     DbiGetErrorString(Error,Special);
     ErrorMsg:='['+InttoStr(Error)+']: '+Special;
  end;
  MessageDlg(ErrorMsg,mtWarning,[mbOK],0);
end;

 

Re:index out of date


1) - use DBISaveChanges at the OnAfterPost for each table
  - or put timer on your main form and use dbiUseIdleTime

2) there's a bug in VCACHE.386.  Remove it from your system.ini.  This
really works

Pascal

--

--------------------------------------------------------------------
ing. Pascal Dutilleul

{*word*137} software engineer (also via internet)

Pascal.Dutill...@ping.be                  Borland Connections Member
--------------------------------------------------------------------

Other Threads