How can I delete all the recors I have in one table.
Printable View
How can I delete all the recors I have in one table.
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
Could you be more specific I´m new at VB programing.
Thanks......
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
The SQL way is much better than this, but this way will work:
rst.MoveFirst
Do Until rst.EOF
rst.Delete
rst.MoveNext
Loop