Board index » delphi » Tdataset.edit doesn't work

Tdataset.edit doesn't work

I fixed your code:

Quote
Hong Yu) <y...@lucent.com> wrote in message

news:380003DB.51B914B@lucent.com...
Quote
> I wrote the following lines to delete records in a Foxpro table,

> procedure TMainForm.Button2Click(Sender: TObject);
> begin

  Table1.delete;  {will delete current record}
Quote
> end;

> But when I run it, it tells me that table1 is not in edit or insert
> mode. I called edit. Why does this happen?

> Thanks

>  Hong Yu

 

Re:Tdataset.edit doesn't work


I wrote the following lines to delete records in a Foxpro table,

procedure TMainForm.Button2Click(Sender: TObject);
begin
with table1 do
begin
edit;
delete;
post;
end;

But when I run it, it tells me that table1 is not in edit or insert
mode. I called edit. Why does this happen?

Thanks

 Hong Yu

Re:Tdataset.edit doesn't work


Do not call Edit or Post. Just call the Delete method to delete the current
record.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to questions received via email)

Other Threads