PDA

Click to See Complete Forum and Search --> : deleting records


jrgmrz
Nov 2nd, 2000, 07:00 PM
How can I delete all the recors I have in one table.

JHausmann
Nov 2nd, 2000, 07:07 PM
In SQL you can

1) delete from table [don't qualify the delete with a where condition]

2) drop the table and add it back again

jrgmrz
Nov 3rd, 2000, 09:17 AM
Could you be more specific I´m new at VB programing.

Thanks......

paulw
Nov 3rd, 2000, 10:45 AM
DELETE * FROM TableName

or

DROP TABLE TableName

followed by

CREATE TABLE TableName (field1 type [(size)] [NOT NULL] [index1] [, field2 type [(size)] [NOT NULL] [index2] [, ...]] [, CONSTRAINT multifieldindex [, ...]])

You can see that the first one is easier!

Cheers,

Paul

jmcswain
Nov 3rd, 2000, 12:07 PM
The SQL way is much better than this, but this way will work:

rst.MoveFirst
Do Until rst.EOF
rst.Delete
rst.MoveNext
Loop