ASP Tutorials

Delete records

delete.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file = "data_source.inc" -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Delete</title>
</head>

<body>
<%
Dim my_connection, my_query, my_recordset
Dim quote_id

quote_id=request.querystring("quote_id")

set my_connection = server.createObject("ADODB.Connection")
set my_recordset = server.createObject("ADODB.Recordset")

my_connection.open(my_database_source)
my_query = "DELETE * FROM my_quotes WHERE quote_id=" & quote_id

my_connection.execute(my_query)
response.write "<div>The record has been deleted from the database!</div>"

my_connection.close
set my_connection = nothing
%>
</body>
</html>

ASP Tutorials
Other Tutorials