论文无忧网提供:计算机毕业论文范文|计算机毕业设计|计算机毕业论文
栏目导航 ASP JSP .NET VB6.0 JAVA VC VF DELPHI PB 计算机网络 计算机科学与技术 PHP 安卓APP 其他 C# 代写论文
当前位置: > 计算机 > ASP >

A400121学生管理系统 ASP+ACCESS (毕业论文+代码)

 

3.2       登录3.2.1   系统总模型

copyright paper51.com

学生信息管理系统总的模型主要是说明系统注册后才能登录,登录后进么主页面后实现主要有学生资料管理、管理员管理以及更改级别,其中学生资料管理主要实现学生信息的添加、修改、删除和查询功能。管理员管理是只有权限最高的管理员才能进行删除管理员和更改权限的操作。其结构图如下:

copyright paper51.com

copyright paper51.com

3.2.2  登录界面 内容来自www.paper51.com

(1)只有通过index.asp登录界面才能进入主页面进行相应学生信息的操作。

内容来自www.paper51.com

(2)进入登录界面:通过注册页面让用户提交注册并保存在user表里,并通过登录页面读取用户提交的 登录信息与保存在数据库中的数据进行比较以验证是否成功登录。

paper51.com

图1:用户登录界面

内容来自www.paper51.com

paper51.com

3.2.3  主页面的实现

内容来自www.paper51.com

paper51.com

图2:主页面

paper51.com

学生信息管理系统主要是与数据库的连接,然后数据库的连接必须使用ADO的内置Connection对象,并且调用Recordset对象来进行与数据库的查找、删除、更改等功能,具体脚本如下:

内容来自论文无忧网 www.paper51.com

<% http://www.paper51.com

  dim username,password http://www.paper51.com

  dim cnn,rst,ssql 内容来自论文无忧网 www.paper51.com

  username=trim(request.form("txtusername"))

http://www.paper51.com

 password=trim(request.form("txtpassword")) paper51.com

  login=request.form("btnlogin") 内容来自www.paper51.com

 'if login="" andsession("username")="" then response.redirect"login.htm"

内容来自论文无忧网 www.paper51.com

 if (username="" orpassword="" ) and login<>"" then response.redirect"login.htm"

http://www.paper51.com

%>

内容来自www.paper51.com

<%

paper51.com

'ifseesion("username")="" or(session("username")<>username andseesion("username")<>"") then http://www.paper51.com

 setcnn=server.createobject("adodb.connection") http://www.paper51.com

 setrst=server.CreateObject("adodb.recordset") 内容来自www.paper51.com

 cnn.connectionstring="provider=microsoft.jet.oledb.4.0;datasource="&server.MapPath("Date\date.mdb ") 内容来自www.paper51.com

 cnn.open 内容来自www.paper51.com

 ssql="select * from users whereuser_name='"&username&"' and mm='"&password&"' "

copyright paper51.com

 set rst =cnn.execute(ssql, ,adcmtext) 内容来自论文无忧网 www.paper51.com

 if rst.eof then paper51.com

    response.Write"<p align=center><b>Username or Passwordis  error.sorry!</b></p>"

paper51.com

     response.write"<palign=center><a href=login.asp>重新登录(restart login)</a></p>" 内容来自论文无忧网 www.paper51.com

  else

paper51.com

 session("username")=rst("user_name")

内容来自论文无忧网 www.paper51.com

session("level")=rst("purview_level")

内容来自www.paper51.com

    end if copyright paper51.com

%>

http://www.paper51.com

3.3       后台主要功能的实现3.3.1  添加学生信息资料

copyright paper51.com

在学生信息管理系统首页(index.asp)单击“添加资料”链接,可以进入addinfo.asp页面,在该页面中输入学生资料,并提交给saveinfo.asp页面进行添加,将数据保存到数据库中。界面如下: paper51.com

paper51.com

                             图1 添加页面addinfo.asp copyright paper51.com

实现功能脚本如下: 内容来自www.paper51.com

<!-- #include  file="Date\adovbs.inc" -->

paper51.com

<% http://www.paper51.com

Dim cnn, rst, sSQL

paper51.com

Dim StudentNum,StudentName, StudentSex, BirthDate, Department paper51.com

Dim Speciality, Grade,sClass, ParentName, HomeAddr, HomePhone, Remark copyright paper51.com

StudentNum =Trim(Request.Form("txtStudentNum")) copyright paper51.com

StudentName =Trim(Request.Form("txtStudentName"))

paper51.com

StudentSex =Request.Form("optStudentSex")

内容来自论文无忧网 www.paper51.com

BirthDate =Trim(Request.Form("txtBirthDate")) http://www.paper51.com

Department = Trim(Request.Form("txtDepartment")) 内容来自论文无忧网 www.paper51.com

Speciality =Trim(Request.Form("txtSpeciality")) 内容来自www.paper51.com

Grade =Trim(Request.Form("txtGrade"))

copyright paper51.com

sClass =Trim(Request.Form("txtClass"))

http://www.paper51.com

ParentName =Trim(Request.Form("txtParentName")) 内容来自论文无忧网 www.paper51.com

HomeAddr =Trim(Request.Form("txtHomeAddr")) http://www.paper51.com

HomePhone =Trim(Request.Form("txtHomePhone"))

paper51.com

Remark =Trim(Request.Form("txtRemark"))

http://www.paper51.com

If StudentNum ="" Or StudentName = "" Then paper51.com

  Response.Redirect"addInfo.asp" http://www.paper51.com

End If copyright paper51.com

Set cnn =Server.CreateObject("ADODB.Connection")

copyright paper51.com

Set rst =Server.CreateObject("ADODB.Recordset") copyright paper51.com

cnn.ConnectionString ="PROVIDER=microsoft.jet.oledb.4.0;DATA SOURCE=" &server.mappath("Date\date.mdb") 内容来自论文无忧网 www.paper51.com

cnn.Open copyright paper51.com

sSQL = "SELECTstudent_num FROM students WHERE student_num='" & StudentNum &"'"

copyright paper51.com

Set rst =cnn.Execute(sSQL, , adCmdText)

内容来自论文无忧网 www.paper51.com

If Not rst.EOF Then

内容来自论文无忧网 www.paper51.com

  Response.Write "<P>学号“" &rst("student_num") & "”已经存在,请重新输入!</P>"

内容来自www.paper51.com

Else copyright paper51.com

  sSQL = "INSERT intostudents(student_num, student_name, " & "student_sex, birthdate,department, speciality," paper51.com

  sSQL = sSQL & "grade, class,home_addr, parent_name, "

内容来自论文无忧网 www.paper51.com

  sSQL = sSQL & "home_phone,remark) VALUES('" paper51.com

  sSQL = sSQL & StudentNum &"','" & StudentName & "','" & StudentSex &"','" & BirthDate & "','"

copyright paper51.com

  sSQL = sSQL & Department &"','" & Speciality & "','" & Grade &"','" & sClass & "','"

内容来自论文无忧网 www.paper51.com

  sSQL = sSQL & HomeAddr &"','" & ParentName & "','" & HomePhone &"','" & Remark & "')"

http://www.paper51.com

  cnn.Execute sSQL, , adCmdText http://www.paper51.com

%>

内容来自论文无忧网 www.paper51.com

<HR NOSHADE SIZE ="1" COLOR = "red"> http://www.paper51.com

<Pclass="STYLE1">数据保存成功!</P> 内容来自论文无忧网 www.paper51.com

<% End If %>

http://www.paper51.com

3.3.2  修改学生资料

copyright paper51.com

在学生信息管理系统首页(index.asp)单击“修改资料”链接,可以进入editinfo.asp页面,在该页面中输入学生资料,并提交给editinfo2.asp页面进行修改,将数据进行修改操作中。界面如下:

http://www.paper51.com

copyright paper51.com

图2 修改页面editinfo.asp

paper51.com

实现功能脚本如下: http://www.paper51.com

<!-- #include file="Date\adovbs.inc" -->

内容来自www.paper51.com

<% http://www.paper51.com

Dim cnn, rst, sSQL, StuNum paper51.com

StuNum = Trim(Request.Form("txtStuNum"))

paper51.com

Set cnn = Server.CreateObject("ADODB.Connection")

http://www.paper51.com

Set rst = Server.CreateObject("ADODB.Recordset")

paper51.com

cnn.ConnectionString = "PROVIDER=microsoft.jet.oledb.4.0;DATASOURCE=" & server.mappath("Date\date.mdb") paper51.com

cnn.Open

copyright paper51.com

If StuNum <> "" Then

paper51.com

  sSQL = "SELECT *FROM students WHERE student_num='" & StuNum & "'" http://www.paper51.com

  Set rst =cnn.Execute(sSQL, , adCmdText)

copyright paper51.com

  If rst.EOF Then

copyright paper51.com

   Response.Write "<P><FONT COLOR = red>没有找到符合条件的记录!</FONT></P>" 内容来自www.paper51.com

  Else copyright paper51.com

%> copyright paper51.com

<FORM METHOD = "post" ACTION ="editInfo2.asp"> http://www.paper51.com

<TABLE border="1" align="center"cellpadding="2" cellspacing="1"bordercolor="#0099FF" BGCOLOR = "#B5E6FF"> http://www.paper51.com

<TR ALIGN = "center"> copyright paper51.com

<TH COLSPAN = "6" BGCOLOR = "#0034FF">

内容来自www.paper51.com

<FONT COLOR = "#FFFFFF">修改学生资料</FONT></TH> http://www.paper51.com

</TR> 内容来自www.paper51.com

<TR>

内容来自论文无忧网 www.paper51.com

<TD ALIGN = "right">学号:</TD> paper51.com

<TD><INPUT TYPE = "text" NAME ="txtStudentNum" SIZE = "12"

paper51.com

VALUE = <% = rst("student_num")%>>

paper51.com

<INPUT TYPE = "hidden" NAME = "txtOldStuNum"SIZE = "12"

copyright paper51.com

VALUE = <% = rst("student_num")%>></TD>

内容来自论文无忧网 www.paper51.com

<TD ALIGN = "right">姓名:</TD>

内容来自www.paper51.com

<TD><INPUT TYPE = "text" NAME ="txtStudentName" SIZE = "12"

paper51.com

VALUE = <% = rst("student_name")%>></TD>

http://www.paper51.com

<TD ALIGN = "right">性别:</TD> copyright paper51.com

<TD><INPUT TYPE = "radio" VALUE = "男"

内容来自www.paper51.com

NAME="optStudentSex" <% = IIf( rst("student_sex")= "男") %>>男 copyright paper51.com

<INPUT TYPE="radio" VALUE="女" 内容来自论文无忧网 www.paper51.com

NAME="optStudentSex" <% = IIf(rst("student_sex") = "女")%>>女</TD>

内容来自论文无忧网 www.paper51.com

</TR>

内容来自论文无忧网 www.paper51.com

<TR>

http://www.paper51.com

<TD ALIGN = "right">出生日期:</TD> copyright paper51.com

<TD><INPUT TYPE = "text" NAME ="txtBirthDate" SIZE = "12" 内容来自论文无忧网 www.paper51.com

VALUE = <% = rst("birthdate") %>></TD> copyright paper51.com

<TD ALIGN = "right">所在院系:</TD>

paper51.com

<TD><INPUT TYPE = "text" NAME ="txtDepartment" SIZE = "12"

copyright paper51.com

VALUE = <% = rst("department") %>></TD>

copyright paper51.com

<TD ALIGN = "right">所在专业:</TD> copyright paper51.com

<TD><INPUT TYPE = "text" NAME ="txtSpeciality" SIZE = "12"

paper51.com

VALUE = <% = rst("speciality") %>></TD>

http://www.paper51.com

</TR>

内容来自www.paper51.com

<TR> copyright paper51.com

<TD ALIGN = "right">年级:</TD> paper51.com

<TD><INPUT TYPE = "text" NAME ="txtGrade" SIZE = "12" http://www.paper51.com

VALUE = <% = rst("grade") %>></TD>

copyright paper51.com

<TD ALIGN = "right">班级:</TD> http://www.paper51.com

<TD><INPUT TYPE = "text" NAME ="txtClass" SIZE = "12"

paper51.com

VALUE = <% = rst("class") %>></TD>

paper51.com

<TD ALIGN = "right">家长姓名:</TD> paper51.com

<TD><INPUT TYPE = "text" NAME ="txtParentName" SIZE = "12"

内容来自www.paper51.com

VALUE = <% = rst("parent_name") %>></TD> copyright paper51.com

</TR> 内容来自www.paper51.com

<TR> paper51.com

<TD ALIGN = "right">家庭住址:</TD> http://www.paper51.com

<TD COLSPAN = "3"><INPUT TYPE = "text"

内容来自论文无忧网 www.paper51.com

NAME = "txtHomeAddr" SIZE = "33" VALUE = <% =rst("home_addr") %>></TD> paper51.com

<TD ALIGN = "right">住宅电话:</TD>

http://www.paper51.com

<TD><INPUT TYPE = "text" NAME ="txtHomePhone" SIZE = "12" paper51.com

VALUE = <% = rst("home_phone") %>></TD>

paper51.com

</TR> paper51.com

<TR> 内容来自www.paper51.com

<TD ALIGN = "right">备注:</TD> copyright paper51.com

<TD COLSPAN = "5"><TEXTAREA ROWS = "3"NAME = "txtRemark" 内容来自论文无忧网 www.paper51.com

COLS = "58"><% = rst("remark")%></TEXTAREA></TD>

paper51.com

</TR>

http://www.paper51.com

<TR ALIGN = "center"> 内容来自www.paper51.com

<TD COLSPAN = "6"><INPUT TYPE ="submit" VALUE = "保存数据" copyright paper51.com

NAME = "btnSave">

http://www.paper51.com

&nbsp;&nbsp;&nbsp;<INPUT TYPE="reset" VALUE= "全部重写" paper51.com

NAME = "btnReset"></TD>

paper51.com

</TR>

内容来自www.paper51.com

</TABLE>

http://www.paper51.com

</FORM> 内容来自www.paper51.com

<% 内容来自www.paper51.com

End If

http://www.paper51.com

End If

copyright paper51.com

%>

paper51.com

------分隔线----------------------------
联系方式