毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

VB+Access2000学生信息管理系统 第5页

更新时间:2008-1-6:  来源:毕业论文

VB+Access2000学生信息管理系统 第5页

5-2-3(3)

 

学生信息管理部分包括班级管理、学生档案管理、学生交费管理、课程管理、成绩管理。而每一部分都包括对该部分信息的添加、浏览查询、修改、删除。其实现过程是相似的。我们以学生档案管理为例,介绍其实现过程。

 

5.2.4 学生档案管理界面

 

点击后出现如图5-2-4(1)界面。

5-2-4(1)

 

在学生信息管理的添加界面中,我们先通过变量传递得到输入的学号,然后进行判断。

首先程序先对输入的学号进行判断,若已存在,则给出提示信息,若不存在,则显示所要添加的内容。输入学生信息后,我们将信息加入到数据库中,如图5-2-4(2)对于记录删除,可以使用下面程序完成:

Dim mrc As ADODB.Recordset

 txtsql1 = "select * from xj where 学号='" & Trim(Text1(0).Text) & "'"

  Set mrc = ExecuteSQL(txtsql1)

If modi = False Then

  If mrc.EOF = False Then

   sss = MsgBox("已经存在该学号的记录,学号不能重复!", vbExclamation + vbOKOnly, "警告")

   Text1(0).SetFocus

    Text1(0).SelStart = 0

   Text1(0).SelLength = Len(Text1(0).Text)

   mrc.Close

   Exit Sub

 End If

 

5-2-4(2)

 

另外,对于记录查找,可以使用下面程序来完成:

Dim aa As Integer

 txtsql = ""

If Trim(Text1(0).Text) <> "" Then

  aa = 1

  If txtsql = "" Then

    txtsql = "xj.学号='" & Trim(Text1(0).Text) & "'"

  Else

 txtsql = txtsql & "and xj.学号='" & Trim(Text1(0).Text) & "'"

  End If

End If

If Trim(Text1(1).Text) <> "" Then

aa = 1

  If txtsql = "" Then

    txtsql = "xj.姓名='" & Trim(Text1(1).Text) & "'"

  Else

    txtsql = txtsql & "and xj.姓名='" & Trim(Text1(1).Text) & "'"

  End If

End If

If Trim(Text1(2).Text) <> "" Then

  aa = 1

  If txtsql = "" Then

    txtsql = "xj.班级='" & Trim(Text1(2).Text) & "'"

  Else

    txtsql = txtsql & "and xj.班级='" & Trim(Text1(2).Text) & "'"

  End If

End If

If Trim(Text1(3).Text) <> "" Then

 aa = 1

 txtsql = ""

txtsql = "xj.姓名 like '%" & Trim(Text1(3).Text) & "%'"

End If

If aa = 0 Then

  ss = MsgBox("你至少要输入一个条件以上才能查询!", , " 警告")

  Text1(0).SetFocus

  Exit Sub

End If

Dim str As String

str = "select * from xj where " & txtsql

Dim mrc As ADODB.Recordset

Set mrc = ExecuteSQL(str)

If mrc.EOF = True Then

 zzz = MsgBox("对不起,没有此学生的档案记录!", vbOKOnly, "查询")

   Form4.ZOrder (0)

   Form4.Text1(0).SetFocus

   Exit Sub

End If                                                                       

 

对于记录修改,可以使用下面程序:

If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then

                  sssss = MsgBox("你还没有选择记录!", vbOKOnly + vbExclamation, "警告")

                Exit Sub

               Else

               qxstr = Executeqx(2)

              If qxstr = "readonly" Then

              ss = MsgBox("对不起,你是只读用户不能修改记录,请与管理员联系!", vbInformation + vbOKOnly, " 警告")

              Exit Sub

               End If

               modi = True

               Form1.Show

               Form1.ZOrder 0

               End If                                                      

 

对于记录删除,可以使用下面程序:

Dim mrc As ADODB.Recordset

             Dim intcount As Integer

              If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then

              sssss = MsgBox("你还没有选择记录!", vbOKOnly + vbExclamation, "警告")

              Else

              If qxstr = "readonly" Then

              ss = MsgBox("对不起,你是只读用户不能删除记录,请与管理员联系!", vbInformation + vbOKOnly, " 警告")

              Exit Sub

              End If

              If MsgBox("确定要删除学号为 " & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & " 的记录吗?" & Chr(10) & Chr(13) & "该操作会导致该学生交费记录和成绩记录的丢失!确定吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then

             intcount = Me.MSF1.Row

            txtsql = "delete * from xj where 学号='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"

           Set mrc = ExecuteSQL(txtsql)

           txtsql = "delete * from jf where 学号='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"

           Set mrc = ExecuteSQL(txtsql)

           txtsql = "delete * from cj where 学号='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"

           Set mrc = ExecuteSQL(txtsql)

             TreeView1_DblClick

             End If

             End If

5-2-4(3)为浏览界面,在此处可以进行查找、修改、删除和打印工作。

                            5-2-4(3)

下面的图5-2-4(4)为查询界面,可在此处进行记录的查询。

上一页  [1] [2] [3] [4] [5] [6] [7] [8] 下一页

VB+Access2000学生信息管理系统 第5页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。