TDBF -unable to share DBFs with FoxPro, true? lazarus / 16-Databases ---------------------------------------------------------------------- xaver13 · 2012-09-20 06:34 Hello, seems to me that neither cdx index files but also idx are not implemented in TDBF? I am getting an error index based on unknown field "YR" on line MyDbf.OpenIndexFile('VYR~V.IDX'); in folowing sample. (index is based on RZNAK+CVYR) The packed full small sample containing dbf and index is here http://www.cvrk.com/reindex.zip Main code: Code: [Select]program Reindex; {$mode objfpc}{$H+} uses   { We will require the following units be in the USES clause: }   Dbf, db, Dbf_Common, SysUtils,   { The Dbf is put there e.g. when you drop a TDbf component on a form...   }   { but you will need db for the DataSet object and Dbf_Common            }   { for things such as the field type definitions                         }   { Finally, use SysUtils for ForceDirectories.                           }   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Classes   { you can add units after this }; var   MyDbf: TDbf; begin   MyDbf := TDbf.Create(nil);   try     { make sure the data directory exists: }     ForceDirectories('data');     { use relative path to "data" directory }     MyDbf.FilePath := 'data' + DirectorySeparator;     // Note: November 2011: tablelevel 25 does not seem to work...     MyDbf.TableLevel := 4;     MyDbf.Exclusive := True;     MyDbf.TableName := 'vyr.dbf';     MyDbf.Open;     MyDbf.OpenIndexFile('VYR~V.IDX');     //MyDbf.OpenIndexFile('VYR.CDX');     MyDbf.RegenerateIndexes;     MyDbf.Close;   finally     MyDbf.Free;   end;   readln; end. Thank you for any possible suggestions.. ---------------------------------------------------------------------- BigChimp · 2012-09-20 07:39 AFAIR, TDBF does not support FoxPro indexes, no. Can you use index files that both FoxPro and TDBF support perhaps? (If you have a patch for .cdx/.idx, I'd love to help get this into FPC's TDBF). ---------------------------------------------------------------------- xaver13 · 2012-09-20 11:04 I have found on the net http://pascal.sources.ru/database/index.htm two works of the russian programmers http://pascal.sources.ru/database/swdbase.zip http://pascal.sources.ru/database/swdbase.htm http://pascal.sources.ru/database/fox.htm http://pascal.sources.ru/database/fox.zip but for me it is too complicated so far. ---------------------------------------------------------------------- BigChimp · 2012-09-22 20:49 Some information on .idx files (Visual FoxPro, don't know what flavors there are...) stackoverflow question on idx: http://stackoverflow.com/questions/404015/visual-foxpro-compact-index- file-format idx: http://msdn.microsoft.com/en-us/library/s8tb8f47%28VS.80%29.aspx cdx: http://msdn.microsoft.com/en-US/library/k35b9hs2%28v=vs.80%29.aspx table file structure (dbf, fpt which contains memo fields etc): http://msdn.microsoft.com/en-US/library/st4a0s68%28v=vs.80%29.aspx