<%@ Language="VBScript"%> <% If Request.Querystring("ID") = "" Then %> <% NewsPos = request.querystring("or") Set objCon = Server.CreateObject ("ADODB.Connection") Set objRec = Server.CreateObject ("ADODB.Recordset") ' This is the limit size of news will display objRec.PageSize = 7 ' Do not limit the Cache Size objCon.Open Dbcon SQL = "SELECT * FROM gallery ORDER BY ID DESC" objRec.Open SQL, objCon ' Move the cursor on the last displayed record objRec.Move NewsPos %>

Delete Images From the Database

<% Do While DisplayNum < objRec.PageSize AND NOT objRec.EOF %>

">Delete
">
<% = ObjRec("image")%> and
<% = ObjRec("imglarge")%>


<% DisplayNum = DisplayNum + 1 objRec.MoveNext Loop %> <% if Not objRec.EOF Then %>
more pictures <% End if If ObjRec.EOF = True Then Response.Write "Back " end if %> <% Else %> <% Set objCon = Server.CreateObject ("ADODB.Connection") objCon.Open Dbcon objCon.Execute ("DELETE FROM [gallery] WHERE gallery.Id= " & Request.Querystring("ID") & ";") ObjCon.Close Response.Write ("Your record has been deleted from the database.
Back ") End If %>