Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindKey in Tables .dbf

Status
Not open for further replies.

zlaja

Programmer
Oct 1, 2001
14
0
0
CA
Hi,

Can someone helps me?(I have never worked with tables .dbf). I would like read informations from tables .dbf, but it doesn't work. My code is similar to this:

with Table1 do begin
ACTIVE := TRUE;
IndexName := 'STCLASM1';
FindKey(['10']);
E.Text:= table1.fieldByName('clas_fdesc').AsString;
end;

The message I receive is: Table is busy!

If I do copy of table it works, but I would like to be able find my data even if the table is in use. The index files have extension cdx. I do same things with tables Paradox and SQL and I don't have the problems.

I will appreciate any help!
 
Zlaja

You cannot change/set the Index if the Table is Active, Try this code.

with Table1 do begin
ACTIVE := FALSE;
IndexName := 'STCLASM1';
ACTIVE := TRUE;
FindKey(['10']);
E.Text:= table1.fieldByName('clas_fdesc').AsString;
end;

Mark Moss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top