ASP Delete - Sample ASP Files Delete Motes Notes...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Sample ASP Files - Delete Mote’s Notes 4/25/2011 Delete1A.asp This small example allows the user to select a family member from a drop-down list. Their FID is then passed to the second ASP script where a DELETE command deletes the selected person from tblFamily. The drop-down list shows every family member (of every employee). That is potentially a long, inconvenient list.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Delete1A.asp <html> <head> <title>Delete 1A</title> <link rel=stylesheet type='text/css' href='MyStyle.css'> </head> <!--#include file="MyInfo.asp" --> <body> <% Response.Write("<h2>Delete 1A: Delete Family Member</h2>") ' Open connection to back-end SQL Server database Set conn=Server.CreateObject("ADODB.Connection") conn.CommandTimeout=15 conn.ConnectionTimeout=15 conn.Open BackEnd ' Begin input form Response.Write("<form action='Delete1A-Step2.asp' method='post'>") ' Display input fields Response.Write("<table border=0>") sql="SELECT FirstName, LastName, FID FROM tblFamily ORDER BY LastName, FirstName" Set rst=Server.CreateObject("ADODB.Recordset") rst.Open sql, conn Response.Write("<tr><th align='left'>Person</th><td align='left'>") Response.Write("<select name='FID' style='width:200px'>") Response.Write("<option value=''></option>") Do Until rst.EOF Display=rst("FirstName") & " " & rst("LastName") & " [" & rst("FID") & "]" Response.Write("<option value='" & rst("FID") & "'>" & Display & "</option>") rst.MoveNext Loop Response.Write("</select>") Response.Write("</td></tr>") rst.Close Set rst=Nothing ' Display buttons Response.Write("<tr><th></th><td align='left'><input type='submit' value='Delete' style='width:98px'> <input type='reset' value='Clear' style='width:98px'></td></tr>") Response.Write("</table>") ' End input form Response.Write("</form>") ' Close database connection conn.Close Set conn=Nothing %> </body> </html>
Background image of page 2
3 Delete1A-Step2.asp <html> <head> <title>Delete 1A</title> <link rel=stylesheet type='text/css' href='MyStyle.css'>
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/26/2011 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas.

Page1 / 8

ASP Delete - Sample ASP Files Delete Motes Notes...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online