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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting all rows.. 1

Status
Not open for further replies.

paul102384

Programmer
Oct 5, 2007
30
hi to all pb programmers;

Can somebody help me on how to delete all rows on a datawindow.

For example there are five rows in dw_1... then delete this five rows in just one execution.

Pls. give a sample code to do this..

thanks!..
 
There are 2 ways to do as far as I know.

1. You can delete all rows which is recomended as you might need the rows later from the deleted buffer. this is when you want to update the deleted rows that they might be deleted in the database too.

Code:
DO WHILE dw_1.Rowcount() > 0
   dw_1.DeleteRow(1)
LOOP

2. If you do not need to update/delete the rows in database just performe a simple reset on the datawindow. This will delete all data information

Code:
dw_1.Reset()

 
You can also use 'rowsmove' and move all the rows to the delete buffer directly

dw_1.RowsMove(1,dw_1.rowcount(),Primary!,dw_1,1,Delete!)

this will move all rows from the dw_1 Primary buffer to the Delete buffer where the rows will be deleted when you update dw_1.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top