📄 editinfo1.asp
字号:
<% @ LANGUAGE = "VBScript" %>
<%
' 定义函数IIf,当参数e为True时返回字符串“CHECKED”
Function IIf( e )
If e = True Then
IIf = "CHECKED"
End If
End Function
%>
<HTML>
<HEAD>
<TITLE>修改学生资料</TITLE>
<STYLE>
P, TABLE, INPUT, TEXTAREA{FONT-SIZE: 9pt}
</STYLE>
</HEAD>
<BODY>
<%
If Session("UserName")="" Or Session("Level") < 2 Then
Response.Write "你没有访问本页面的权限!"
Response.End
End If
%>
<P><A HREF = "index.asp">返回首页</A>|
<A HREF = "addinfo.asp">添加资料</A>|
<A HREF = "deleteinfo1.asp">删除资料</A>|
<A HREF = "browseinfo.asp">查询资料</A></P>
<DIV ALIGN = "center">
<FORM METHOD = "post" ACTION = "editInfo1.asp">
<P>请输入学号:
<INPUT TYPE = "text" NAME = "txtStuNum" SIZE = "20">
<input type="submit" value="提交" name="btnSubmit">
</P>
</FORM>
<!-- #include virtual = "/adovbs.inc" -->
<%
Dim cnn, rst, sSQL, StuNum
StuNum = Trim(Request.Form("txtStuNum"))
Set cnn = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
cnn.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=g6;" & _
"UID=sa;;DATABASE=test"
cnn.Open
If StuNum <> "" Then
sSQL = "SELECT * FROM students WHERE student_num='" & StuNum & "'"
Set rst = cnn.Execute(sSQL, , adCmdText)
If rst.EOF Then
Response.Write "<P><FONT COLOR = red>没有找到符合条件的记录!</FONT></P>"
Else
%>
<FORM METHOD = "post" ACTION = "editInfo2.asp">
<TABLE BGCOLOR = "#D6D3CE">
<TR ALIGN = "center">
<TH COLSPAN = "6" BGCOLOR = "#0034FF">
<FONT COLOR = "#FFFFFF">修改学生资料</FONT></TH>
</TR>
<TR>
<TD width="62" ALIGN = "right">学号:</TD>
<TD width="100"><INPUT TYPE = "text" NAME = "txtStudentNum" SIZE = "12"
VALUE = <% = rst("student_num")%>>
<INPUT TYPE = "hidden" NAME = "txtOldStuNum" SIZE = "12"
VALUE = <% = rst("student_num")%>></TD>
<TD width="60" ALIGN = "right">姓名:</TD>
<TD width="102"><INPUT TYPE = "text" NAME = "txtStudentName" SIZE = "12"
VALUE = <% = rst("student_name")%>></TD>
<TD width="60" ALIGN = "right">性别:</TD>
<TD width="100"><INPUT TYPE = "radio" VALUE = "男"
NAME="optStudentSex" <% = IIf( rst("student_sex") = "男") %>>男
<INPUT TYPE="radio" VALUE="女"
NAME="optStudentSex" <% = IIf( rst("student_sex") = "女") %>>女</TD>
</TR>
<TR>
<TD ALIGN = "right">出生日期:</TD>
<TD><input type = "text" name = "txtBirthDate" size = "12"
VALUE = <% = rst("birthdate") %>></TD>
<TD ALIGN = "right">所在院系:</TD>
<TD><INPUT TYPE = "text" NAME = "txtDepartment" SIZE = "12"
VALUE = <% = rst("department") %>></TD>
<TD ALIGN = "right">所在专业:</TD>
<TD><INPUT TYPE = "text" NAME = "txtSpeciality" SIZE = "12"
VALUE = <% = rst("speciality") %>></TD>
</TR>
<TR>
<TD ALIGN = "right">年级:</TD>
<TD><INPUT TYPE = "text" NAME = "txtGrade" SIZE = "12"
VALUE = <% = rst("grade") %>></TD>
<TD ALIGN = "right">班级:</TD>
<TD><INPUT TYPE = "text" NAME = "txtClass" SIZE = "12"
VALUE = <% = rst("class") %>></TD>
<TD ALIGN = "right">家长姓名:</TD>
<TD><INPUT TYPE = "text" NAME = "txtParentName" SIZE = "12"
VALUE = <% = rst("parent_name") %>></TD>
</TR>
<TR>
<TD ALIGN = "right">家庭住址:</TD>
<TD COLSPAN = "3"><INPUT TYPE = "text"
NAME = "txtHomeAddr" SIZE = "33" VALUE = <% = rst("home_addr") %>></TD>
<TD ALIGN = "right">住宅电话:</TD>
<TD><INPUT TYPE = "text" NAME = "txtHomePhone" SIZE = "12"
VALUE = <% = rst("home_phone") %>></TD>
</TR>
<TR>
<TD ALIGN = "right">备注:</TD>
<TD COLSPAN = "5"><TEXTAREA ROWS = "3" NAME = "txtRemark"
COLS = "58"><% = rst("remark") %></TEXTAREA></TD>
</TR>
<TR ALIGN = "center">
<TD COLSPAN = "6"><INPUT TYPE = "submit" VALUE = "保存数据"
NAME = "btnSave">
<INPUT TYPE="reset" VALUE = "全部重写"
NAME = "btnReset"></TD>
</TR>
</TABLE>
</FORM>
<%
End If
End If
%>
<DIV>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -