Delphi: Removing rows from a ADOTable

We can remove rows either through ADOTable or using SQLQuery or ADOQuery (both of them run the same SQL query) as was mentioned here.

I would say convenient way for this would be to create PopupMenu with one MenuItem with Caption “Delete current row” with click handler having following code:

procedure TForm1.Deletecurrentrow1Click(Sender: TObject);
begin
ADOTable1.Delete;
end;

You should not forget to assign created popupmenu to corresponding DBGrid you need.

Also, if you choose another way and would like to use TDBNavigator then you will not need any code at all.

Advertisements
This entry was posted in Delphi, Posts in English and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s