%
If Session("logged") <> "1" Then
Response.Redirect("login.asp")
End If
%>
Delete Products
<%
Dim DateID, ConnectionString, cnUpd, recProducts, upl
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../db/db1.mdb") & ";"
Set upl = Server.CreateObject("SoftArtisans.FileUp")
If upl.Form("sended") = "1" Then
Set cnUpd = Server.CreateObject("ADODB.Connection")
cnUpd.Open ConnectionString
Dim updated: updated = 0
If Request.QueryString("del") = "1" Then
Set recProducts = Server.CreateObject("ADODB.Recordset")
recProducts.Open "Select * From Products WHERE id = " & Request.QueryString("id"), cnUpd, 1, 3
If Not recProducts.EOF Then
If recProducts("ProductsImage") <> "" Then
On Error Resume Next
Set objFile = Server.CreateObject("SoftArtisans.FileManager")
objFile.DeleteFile Server.MapPath("../") & "\" & recProducts("ProductsImage"), True
Set objFile = Nothing
End If
recProducts.Delete
recProducts.UpdateBatch
updated = 1
End If
recProducts.Close
Set recProducts = Nothing
If updated = 1 Then
Response.Write("")
End If
End If
cnUpd.Close
Set cnUpd = Nothing
Set recProducts = Nothing
End If
%>
Here You can delete Products
<%
Dim iPos, lgID, pageNumber
Set cnUpd = Server.CreateObject("ADODB.Connection")
cnUpd.Open ConnectionString
Set recProducts = Server.CreateObject("ADODB.Recordset")
recProducts.Open "Select * From Products WHERE id = " & Request.QueryString("id"), cnUpd, adForwardOnly
%>
Back to list of products