คำสั่งลบข้อมูลในฐาน
<%
test_ID=trim(Request.QueryString("Non_ID"))
set rs1 =server.CreateObject("adodb.recordset")
sql1="delete Test where test_ID="&test_ID
rs1.Open sql1,con,1,3
%>
dim mydir, DlPath
DlPath="พาธที่ต้องการลบ"
set mydir=server.CreateObject("Scripting.FileSystemObject")
mydir.DeleteFile DlPath, false
set mydir=nothing
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com ASP FileSystemObject Object</title>
</head>
<body>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
IF objFSO.FileExists(Server.MapPath("MyFiles/thaicreate.txt")) Then '*** Check Exists Files ***'
objFSO.DeleteFile(Server.MapPath("MyFiles/thaicreate.txt"))
Response.write ("File Deleted")
End IF
Set objFSO = Nothing
%>
</body>
</html>