VB to access link problem
I have created a vb6.0 project with 22 forms one after another.Each form has an access table linked to it. At the end when i click the exit button (which is a button on the final form) i want that all the records in all the tables are deleted ....at runtime ofcourse.... please help me.I am using ADO to connect them to the tables.
Re: VB to access link problem
Easiest way it to execute a sql statement to delete the records.
Code:
Cnn.Execute "DELETE FROM Table1;"
Re: VB to access link problem
THANKS that is for one table but what for all the tables ????
Re: VB to access link problem
You need to execute delete statements for each table one at a time. After the
execute statement parameter there is another parameter for records
affected. If you already know the number of records to be deleted you can
supply the second parameter and check against the known number of recs
for a match. Just a second way of verifing that al records were deleted.
Code:
Dim lRecs as long
Cnn.execute "DELETE FROM Table1;", lRecs
Msgbox lrecs & " Record(s) deleted!"