ara72
asked on
Open a table without its index
How can I open a dBase Table when its associate index is not present ?
Well, if I try to open a table when its index associate is not present then BDE raise an exception. An solution for this problem should be open the table at design time but I can't do it because I don't know the table's name. I know the table's names just after run some code.
Somebody help me ?
Well, if I try to open a table when its index associate is not present then BDE raise an exception. An solution for this problem should be open the table at design time but I can't do it because I don't know the table's name. I know the table's names just after run some code.
Somebody help me ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
an older solution :
Q: I have a DBF table that I can't open because it is expecting an MDX (production index) file. I lost (deleted) that file. What do I do now?
A: Byte 28 in the DBF file header indicates whether an MDX file is needed. (0 = no MDX needed; 1 = MDX needed.) Here is some code that makes the change for you. It uses a radio group where the first item is NO MDX (element 0), and the second item is USES MDX (element 1). This app also uses the TOpenDialog component.
procedure TForm1.Button1Click(Sender
var
f: file of byte;
b: byte;
begin
if OpenDialog1.execute then
begin
assignFile(f, OpenDialog1.FileName);
reset(f);
seek(f, 28);
b := RadioGroup1.ItemIndex; {0 = no MDX; 1 = use MDX}
write(f, b);
closefile(f);
end;
OpenDialog1.FileName := '*.dbf'; {reset the filter}
end;
{ This code came from Lloyd's help file! }
Regards, zif.