ASP Database Fundamentals (Part 4) - Deleting Using the Connection Object
(Page 8 of 9 )
And of course, there is the ability to delete records using the handy “execute” method of the connection object and a little SQL as follows:
<%
ConnectionString = "DSN=MyDB”
set conn = server.createobject("adodb.connection")
conn.open ConnectionString
mySql = “Delete from Customers where Status = ‘InActive’ “
conn.execute mySql
conn.close
set conn = nothing
%>
As you can see, the above will delete in one simple statement all records that have an inactive status.
Next: Where Do We Go From Here? >>
More ASP Articles
More By Rich Smith