Friday, December 14, 2007

How to delete a record by using SQL command?

How to delete a record by using SQL command?


You can delete a record by using SQL command.

The ASP codes are written and described as below:



<%

Set conn = Server.CreateObject("Adodb.Connection")

conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db1.mdb")

conn.execute "DELETE * FROM Member WHERE MemID=1" 'Delete the records that member id = 1

conn.Close

Set conn = Nothing

%>

No comments: