ASP学生管理系统 第3页
message="密码或账号不对想混呀!"
response.redirect "enter.asp?message="&message
end if
%>
6-0为显示页面 输入信息后点击开始查找 转到6-01页进行处理并显示
设计代码如下:
<%
set adocon=Server.CreateObject("ADODB.Connection")
adocon.Open "Driver={Microsoft Access Driver (*.mdb)}; " & _
="0" width="100%" cellspacing="0" bordercolor="#0000FF" class="unnamed1" align="center">
<%
i = 1
While Not rs.EOF
if i=1 then
%> <tr> <td class="unnamed2"><b> <center> 序号 </center></b></td><% For j = 0 to rs.Fields.Count -1 %>
<td class="unnamed2"><b> <center> <% =rs(j).Name %> </center></b>
</td><% Next %>
</tr> <% end if %> <tr> <td class="unnamed2"> <center> <% = i %> </center></td>
<td class="unnamed2">
<center> <% = rs("ID") %> </center></td><td class="unnamed2"> <center> <% = rs("班级") %>
</center></td><td class="unnamed2"> <center> <% = rs("姓名") %> </center></td><td class="unnamed2">
<center> <% = rs("体重") %> </center></td><td class="unnamed2"> <center> <% = rs("性别") %>
</center></td><td class="unnamed2"> <center> <% = rs("家庭住址") %> </center></td><td class="unnamed2">
<center> <% = rs("年龄") %> </center></td><td class="unnamed2"> <center> <% = rs("宿舍") %>
</center></td><td class="unnamed2"> <center> <% = rs("学生证号") %> </center></td><td class="unnamed2">
<center> <% = rs("学籍编号") %> </center></td></tr> <%
i = i + 1
rs.Movenext
Wend
rs.Close: Set rs = Nothing
adocon.Close: Set adocon = Nothing
若图片无法显示请联系QQ752018766,本论文免费,转发请注明源于www.751com.cn
增加添加学生模块,对当前数据库信息进行更新,
具体代码如下:
</style><title>添加成功</title> <A HREF="tianjia.asp">继续添加</A> <A HREF="6-0.asp">返回查询</A>
<%
set adocon=Server.CreateObject("ADODB.Connection")
adocon.Open "Driver={Microsoft Access Driver (*.mdb)}; " & _
"dbq=" & Server.MapPath("database.mdb")
set rs = Server.CreateObject("ADODB.recordset")
rs.open "user",adocon,1,3
rs.addnew
rs("班级").value = request.form("1q")
rs("姓名").value = request.form("2q")
rs("体重").value = request.form("3q")
rs("性别").value = request.form("4q")
rs("家庭住址").value = request.form("5q")
rs("年龄").value = request.form("6q")
rs("宿舍").value = request.form("7q")
rs("学生证号").value = request.form("8q")
rs("学籍编号").value = request.form("9q")
rs.update
rs.Close: Set rs = Nothing
adocon.Close: Set adocon = Nothing
%>