Contents of delete1.asp:
<html> <head> <script language="VBScript"> <!--- ---> </script> </head> <body> <b>DELETE WEEKLY TIMECARD</b> <p> <% sub pass1 response.write "<p>Click on the SSN to Delete:<p>" set rs=server.CreateObject("ADODB.Recordset") ds="SELECT * FROM weekly_timecard ORDER by ssn ASC" ds=ds+cstr(Request.Querystring("ssn")) response.write "<p>*** Delete String --->"+ds+"<---" rs.open ds,"DSN=gl001;UID=gl001;PWD=11111" response.write "<p>*** rs opened ok" c=0 response.write "<table border='1'><tr><td></td><td><center><b>SSN</b></td><td><b>Last Name, First Name, Middle Name</td></tr>" while not rs.EOF c=c+1 response.write "<tr><td align='right'>"+cstr(c)+". " response.write "</td><td align='right'><a href='delete1.asp?token=2&ssn="+cstr(rs("ssn"))+"'>" response.write cstr(rs("ssn"))+"</a></td><td>" response.write cstr(rs("last_name")) response.write ", "+cstr(rs("first_name"))+" "+cstr(rs("middle_name"))+"</td></tr>" rs.movenext wend response.write "</table>" rs.close set rs=nothing end sub sub pass2 %> <p>You are about to permanently <b>DELETE</b> the Weekly Time Card for SSN=<% = request.querystring("ssn") %> <p> If you are sure you wish to delete this data click <a href="delete1.asp?token=3&ssn=<% =request.querystring("ssn") %>"> here</a> <p> If not, click <a href="delete1.asp"> here</a> to return to the delete list. <p> <% end sub sub pass3 set cn = Server.CreateObject("ADODB.Connection") fdsn="gl001" fuid="gl001" fpwd="11111" cn.open fdsn,fuid,fpwd response.write "**** cn open ok" Delete_string="DELETE FROM weekly_timecard where ssn="+request.querystring("ssn") response.write "<p>***** Delete_string="+cstr(Delete_string) cn.execute Delete_string, numa if numa = 1 then response.write "<p><b>Deleted SSN="+cstr(request.querystring("ssn"))+" OK</b>" response.write "<p>Click <a href='delete1.asp'> here</a> to delete another" else response.write "<p>DELETE FAILS!!<p>" response.write cstr(request.querystring("ssn")) + " NOT DELETED." end if cn.close set cn=nothing end sub ' '*** top of main ' select case request.querystring("token") case "" call pass1 case "2" call pass2 case "3" call pass3 end select %> </body> </html>
***** end of file *** printed: 84 lines on: 11/23/2009 5:58:24 AM