To avoid the exception ' index no found'  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 07/07/99

Tip accessed 712 times

 


It is the exception that gives us the BDE if we try to use a DBF table of which we lack the file .MDX, (erased or corrupted).

To avoid the error, simply enough with put to cero the byte 28 of the .DBF

Here is a function that make this:


 procedure RemoveMDXByte(dbFile: String);
   { This procedure accepts a DBF file as a parameter.  It will patch}
   { the DBF header, so that it no longer requires the MDX file }
 const
   Value: Byte = 0;
 var
   F: File of byte;
 begin
   AssignFile(F, dbFile);
   Reset(F);
   Seek(F, 28);
   Write(F, Value);
   CloseFile(F);
 end;



Example:


 	RemoveMDXByte('c:\Tabla.dbf');