>I am trying to automate the import of data that is given to me periodically in dBase IV format. Actually it is produced by Codebase. The problem is that I am only receiving the .DBF file and I am not being given the associated .MDX file (the dBase way of doing .CDX files).
>
>When opening a Fox DBF that is missing a CDX, I can just set SAFETY OFF and go ahead, however, I believe Fox is trying to convert the non-existant MDX into a CDX and therefore I get error 1707 (non existant CDX) that I can't get around in code!
>
>If i do this interactively, I get the usual dialog box to ignore/cancel where I can severe any MDX/CDX requirement, but what can I do in code?
>
>
>Thanx
Like in Fox header (byte offset 28) in dBaseIV table there should be a flag indicating it has an MDX file. First I would just try to turn off bit 0 of byte 28 in header.
handle=fopen("db4.dbf",12)
=fseek(handle,28)
nCurByte=fread(handle,1)
=fseek(handle,28)
=fwrite(handle,chr(bitand(asc(nCurByte),0xFE)))
=fclose(handle)
Cetin