This statement enables you to remove specific rows from a table. It provides greater flexibility than the ADO Delete method because it can delete many rows at once.
DELETE [FROM] tablename [WHERE where-expression]
One of the following error values can be returned:
If no WHERE clause is included, DELETE removes all rows from the specified table.
The FROM keyword has no function except to provide SQL compatibility.
Dim rs, i
Set rs = CreateObject("adoce.recordset")
rs.open "create table deleteme (a int, b int, c int)"
rs.open "deleteme", "", 1, 3
For i = 1 To 15
rs.Addnew "a", i
Next
MsgBox rs.recordcount
rs.Close
rs.open "delete deleteme where 'a' > 7"
MsgBox "records deleted"
rs.open "deleteme"
MsgBox rs.recordcount
rs.Close
rs.open "drop table deleteme"
Set rs = Nothing