<%@ Language=VBScript %>
<%
    Set conn = Server.CreateObject("ADODB.Connection")
    mydbFile=Server.MapPath("Northwind.mdb")
    conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & mydbFile & ";"
    myShipper = Cstr(Request.QueryString("ShipperID"))
    If myShipper <>"" Then
       Set rst = Server.CreateObject("ADODB.Recordset")
       rst.Open "Shippers", conn, 3
       rst.Find "ShipperID = " & myShipper
       If rst.EOF Then
          Response.Write "The Shipper ID" & myShipper & " does not exist."
       Else
         On Error Resume Next
         conn.Execute "DELETE * FROM Shippers WHERE ShipperId = " & _
                     myShipper
         If conn.Errors.Count > 0 Then
          Response.Write "Error Number: " & err.Number & "<P>"
          Response.Write "Error Description: " & err.Description _
                           & "<P>"
         Else
          Response.Write "<H2>The Shipper ID " & myShipper &  _
                             " was deleted.</H2>"
         End If
         rst.close
         Set rst = Nothing
       End If
    Else
            Response.Write "The Shipper ID was not supplied. Cannot Delete."
    End If
%>
<HTML>
<HEAD><TITLE>DELETE SHIPPER</TITLE></HEAD>
<BODY>
<HR>
<A HREF="DeleteShipper.html">Please click here to return.</A>
</BODY>
</HTML>
