Network <%@ language=vbscript%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
<%
If Request.ServerVariables ("http_method") = "POST" and Request.Form ("Submit") <> "skip to" then
' If you submit the form content by post
Set Conn=server. CreateObject ("Adodb.connection")
Conn. Connectionstring= "Dsn=testsys"
Conn. Open
Strstid=request.form ("Stid")
Strstname=request.form ("Stname")
If Request.Form ("submit") = "Join" Then
' If a request to join student information is performed
Strsql= "SELECT * from Studentinfo where stid= '" & Strstid & "'"
' Studentinfo the student's record in the table of the database according to the student number to be added
Set Mrs1=conn. Execute (strSQL)
If not (mrs1. BOF and Mrs1. EOF) Then
' If the student number you want to join already exists, you are prompted to re-enter the information
Response.Write "The school number already exists, please re-enter the student information <br>"
Response.Write "<a href=taddstudent.asp?page=" & Request ("page") & "&stname=" & Strstname & " &stid= "& Strstid &" > Return </a> "
Else
' If the student number you want to join does not exist, add the student information to the database
Strsql= "INSERT into Studentinfo (Stname,stid) VALUES (' & Strstname &" ', ' "& Strstid &") "
Conn. Execute (strSQL)
Strstid= ""
Strstname= ""
End If
End If
If Request.Form ("submit") = "Delete" Then
' If it is to delete the student information request
Strsql= "Delete * from Studentinfo where stid= '" & Strstid & "'"
' Delete Student information
Conn. Execute (strSQL)
' Delete the students ' test scores
Strsql= "Delete * from score where stid= '" & Strstid & "'"
Conn. Execute (strSQL)
Strstid= ""
Strstname= ""
End If
Conn. Close
Set conn=nothing
Else
Strstname=request.querystring ("Stname")
Strstid=request.querystring ("Stid")
End If
%>
<form action= "taddstudent.asp" Method=post id=form1 name=form1>
<p><font face= "Young Circle" size=3 color=crimson> Student Information </FONT><BR>
<font face= "" Size=3> Name:
<input id=stname Name=stname value=<%=strstname%>></font><br>
<font face= "" Size=3> School Number:
<input Id=stid Name=stid value=<%=strstid%>></font>
<font face= "" size=3>
<input id=submit1 name=submit type=submit value= Join >
<input id=submit2 name=submit type=submit value= Delete >
</font></p><font face= "" size=3>
<HR>
</FONT>
<P>
<table border=0 cellpadding=1 cellspacing=1 width=75%>
<tr bgcolor=honeydew>
<TD> name </TD>
<TD> School Number </TD></TR>
<%
Set Mrs=server. CreateObject ("Adodb.recordset")
Mrs. activeconnection= "Dsn=testsys"
Mrs. Source= "Select