frmModifysinfo.frm
上传用户:rocksue
上传日期:2013-06-17
资源大小:41926k
文件大小:24k
- VERSION 5.00
- Begin VB.Form frmModifysinfo
- Caption = "修改学籍信息"
- ClientHeight = 7104
- ClientLeft = 48
- ClientTop = 348
- ClientWidth = 8652
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 7104
- ScaleWidth = 8652
- Begin VB.Frame Frame3
- Caption = "修改学籍信息"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1092
- Left = 840
- TabIndex = 23
- Top = 5760
- Width = 6972
- Begin VB.CommandButton editCommand
- Caption = "修改记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 240
- TabIndex = 27
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton updateCommand
- Caption = "更新数据"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 1800
- TabIndex = 26
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton cancelCommand
- Caption = "取消修改记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 3360
- TabIndex = 25
- Top = 360
- Width = 1692
- End
- Begin VB.CommandButton deleteCommand
- Caption = "删除记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 5160
- TabIndex = 24
- Top = 360
- Width = 1452
- End
- End
- Begin VB.Frame Frame2
- Caption = "查看学籍信息"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1092
- Left = 840
- TabIndex = 18
- Top = 4560
- Width = 6972
- Begin VB.CommandButton firstCommand
- Caption = "第一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 240
- TabIndex = 22
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton previousCommand
- Caption = "上一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 1800
- TabIndex = 21
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton nextCommand
- Caption = "下一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 3360
- TabIndex = 20
- Top = 360
- Width = 1452
- End
- Begin VB.CommandButton lastCommand
- Caption = "最后一条记录"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 492
- Left = 4920
- TabIndex = 19
- Top = 360
- Width = 1692
- End
- End
- Begin VB.TextBox txtSID
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 1440
- TabIndex = 8
- Top = 360
- Width = 1692
- End
- Begin VB.ComboBox comboSex
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 312
- ItemData = "frmModifysinfo.frx":0000
- Left = 1440
- List = "frmModifysinfo.frx":0002
- TabIndex = 7
- Top = 960
- Width = 612
- End
- Begin VB.TextBox txtName
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 5880
- TabIndex = 6
- Top = 360
- Width = 1692
- End
- Begin VB.TextBox txtBorndate
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 5880
- TabIndex = 5
- Top = 960
- Width = 1692
- End
- Begin VB.ComboBox comboClassNo
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 312
- Left = 1440
- TabIndex = 4
- Top = 1560
- Width = 1692
- End
- Begin VB.TextBox txtTel
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 5880
- TabIndex = 3
- Top = 1560
- Width = 1692
- End
- Begin VB.TextBox txtRudate
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 1440
- TabIndex = 2
- Top = 2040
- Width = 1692
- End
- Begin VB.TextBox txtAddress
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 852
- Left = 5880
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 1
- Top = 2160
- Width = 2172
- End
- Begin VB.TextBox txtComment
- Enabled = 0 'False
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1572
- Left = 1440
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 0
- Top = 2640
- Width = 2532
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "学号"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 120
- TabIndex = 17
- Top = 360
- Width = 1092
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- Caption = "姓名"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 4560
- TabIndex = 16
- Top = 480
- Width = 1092
- End
- Begin VB.Label Label3
- Alignment = 2 'Center
- Caption = "性别"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 120
- TabIndex = 15
- Top = 960
- Width = 1092
- End
- Begin VB.Label Label4
- Alignment = 2 'Center
- Caption = "出生日期"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 4560
- TabIndex = 14
- Top = 1080
- Width = 1092
- End
- Begin VB.Label Label5
- Alignment = 2 'Center
- Caption = "班号"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 120
- TabIndex = 13
- Top = 1560
- Width = 1092
- End
- Begin VB.Label Label6
- Alignment = 2 'Center
- Caption = "联系电话"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 4560
- TabIndex = 12
- Top = 1560
- Width = 1092
- End
- Begin VB.Label Label7
- Alignment = 2 'Center
- Caption = "入校日期"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 120
- TabIndex = 11
- Top = 2160
- Width = 1092
- End
- Begin VB.Label Label8
- Alignment = 2 'Center
- Caption = "家庭住址"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 252
- Left = 4560
- TabIndex = 10
- Top = 2160
- Width = 1092
- End
- Begin VB.Label Label9
- Alignment = 2 'Center
- Caption = "备注"
- BeginProperty Font
- Name = "宋体"
- Size = 10.8
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 372
- Left = 120
- TabIndex = 9
- Top = 2760
- Width = 1092
- End
- End
- Attribute VB_Name = "frmModifysinfo"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim mrc As ADODB.Recordset
- Dim myBookmark As Variant
- Dim mcclean As Boolean
- Private Sub editCommand_Click()
- mcclean = False
- Frame2.Enabled = False
- firstCommand.Enabled = False
- previousCommand.Enabled = False
- nextCommand.Enabled = False
- lastCommand.Enabled = False
-
- txtSID.Enabled = True
- txtName.Enabled = True
- comboSex.Enabled = True
- txtBorndate.Enabled = True
- comboClassno.Enabled = True
- txtRudate.Enabled = True
- txtTel.Enabled = True
- txtAddress.Enabled = True
- txtComment.Enabled = True
-
- myBookmark = mrc.Bookmark
- End Sub
- Private Sub cancelCommand_Click()
- If Not mcclean Then
- Frame2.Enabled = True
- firstCommand.Enabled = True
- previousCommand.Enabled = True
- nextCommand.Enabled = True
- lastCommand.Enabled = True
-
- txtSID.Enabled = False
- txtName.Enabled = False
- comboSex.Enabled = False
- txtBorndate.Enabled = False
- comboClassno.Enabled = False
- txtRudate.Enabled = False
- txtTel.Enabled = False
- txtAddress.Enabled = False
- txtComment.Enabled = False
-
- mrc.Bookmark = myBookmark
- Call viewData
- Else
- MsgBox "什么都没有修改,有什么好取消的!", vbOKOnly + vbExclamation, "警告"
- End If
-
- End Sub
- Private Sub deleteCommand_Click()
- myBookmark = mrc.Bookmark
- str2$ = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")
- If str2$ = vbOK Then
- mrc.MoveNext
- If mrc.EOF Then
- mrc.MoveFirst
- myBookmark = mrc.Bookmark
- mrc.MoveLast
- mrc.Delete
- mrc.Bookmark = myBookmark
- Call viewData
- Else
- myBookmark = mrc.Bookmark
- mrc.MovePrevious
- mrc.Delete
- mrc.Bookmark = myBookmark
- Call viewData
- End If
- Else
- mrc.Bookmark = myBookmark
- Call viewData
- End If
- End Sub
- Private Sub firstCommand_Click()
- mrc.MoveFirst
- Call viewData
- End Sub
- Private Sub Form_Load()
-
- Dim txtSQL As String
- Dim MsgText As String
-
- txtSQL = "select * from student_Info "
- Set mrc = ExecuteSQL(txtSQL, MsgText)
-
-
-
- mrc.MoveFirst
- Call viewData
- mcbookmark = mrc.Bookmark
- mcclean = True
-
-
-
-
- End Sub
- Public Sub viewData()
- txtSID.Text = mrc.Fields(0)
- txtName.Text = mrc.Fields(1)
- comboSex.Text = mrc.Fields(2)
- txtBorndate.Text = Format(mrc.Fields(3), "yyyy-mm-dd")
- comboClassno.Text = mrc.Fields(4)
- txtTel.Text = mrc.Fields(5)
- txtRudate.Text = Format(mrc.Fields(6), "yyyy-mm-dd")
- txtAddress.Text = mrc.Fields(7)
- txtComment.Text = mrc.Fields(8)
- End Sub
- Private Sub lastCommand_Click()
- mrc.MoveLast
- Call viewData
- End Sub
- Private Sub nextCommand_Click()
- mrc.MoveNext
- If mrc.EOF Then
- mrc.MoveFirst
- End If
- Call viewData
- End Sub
- Private Sub previousCommand_Click()
- mrc.MovePrevious
- If mrc.BOF Then
- mrc.MoveLast
- End If
- Call viewData
- End Sub
- Private Sub updateCommand_Click()
- Dim txtSQL As String
- Dim MsgText As String
- Dim mrcc As ADODB.Recordset
-
- If mcclean Then
- MsgBox "请先修改学籍信息", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- End If
-
- If Not Testtxt(txtSID.Text) Then
- MsgBox "请输入学号!", vbOKOnly + vbExclamation, "警告"
- txtSID.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(txtName.Text) Then
- MsgBox "请输入姓名!", vbOKOnly + vbExclamation, "警告"
- txtName.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(comboSex.Text) Then
- MsgBox "请选择性别!", vbOKOnly + vbExclamation, "警告"
- comboSex.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(txtBorndate.Text) Then
- MsgBox "请输入出生日期!", vbOKOnly + vbExclamation, "警告"
- txtBorndate.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(comboClassno.Text) Then
- MsgBox "请选择班号!", vbOKOnly + vbExclamation, "警告"
- comboClassno.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(txtTel.Text) Then
- MsgBox "请输入联系电话!", vbOKOnly + vbExclamation, "警告"
- txtTel.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(txtRudate.Text) Then
- MsgBox "请输入入校日期!", vbOKOnly + vbExclamation, "警告"
- txtRudate.SetFocus
- Exit Sub
- End If
-
- If Not Testtxt(txtAddress.Text) Then
- MsgBox "请输入家庭住址!", vbOKOnly + vbExclamation, "警告"
- txtAddress.SetFocus
- Exit Sub
- End If
-
- If Not IsNumeric(Trim(txtSID.Text)) Then
- MsgBox "学号请输入数字!", vbOKOnly + vbExclamation, "警告"
- txtSID.SetFocus
- Exit Sub
-
- End If
-
- mrc.Delete
- txtSQL = "select * from student_Info where student_ID = '" & Trim(txtSID.Text) & "'"
- Set mrcc = ExecuteSQL(txtSQL, MsgText)
- If mrcc.EOF = False Then
- MsgBox "学号重复,请重新输入!", vbOKOnly + vbExclamation, "警告"
- mrcc.Close
- txtSID.SetFocus
- Else
- mrcc.Close
- If Not IsDate(txtBorndate.Text) Then
- MsgBox "出生时间应输入日期格式(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
- txtBorndate.SetFocus
- Else
- txtBorndate = Format(txtBorndate, "yyyy-mm-dd")
- If Not IsDate(txtRudate.Text) Then
- MsgBox "入校时间应输入日期格式(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
- txtRudate.SetFocus
- Else
- txtRudate = Format(txtRudate, "yyyy-mm-dd")
-
- mrc.AddNew
- mrc.Fields(0) = Trim(txtSID.Text)
- mrc.Fields(1) = Trim(txtName.Text)
- mrc.Fields(2) = Trim(comboSex.Text)
- mrc.Fields(3) = Trim(txtBorndate.Text)
- mrc.Fields(4) = Trim(comboClassno.Text)
- mrc.Fields(5) = Trim(txtTel.Text)
- mrc.Fields(6) = Trim(txtRudate.Text)
- mrc.Fields(7) = Trim(txtAddress.Text)
- mrc.Fields(8) = Trim(txtComment.Text)
- mrc.Update
- MsgBox "修改学籍信息成功!", vbOKOnly + vbExclamation, "修改学籍信息"
-
- mrc.Bookmark = myBookmark
- Call viewData
- Frame2.Enabled = True
- firstCommand.Enabled = True
- previousCommand.Enabled = True
- nextCommand.Enabled = True
- lastCommand.Enabled = True
-
- txtSID.Enabled = False
- txtName.Enabled = False
- comboSex.Enabled = False
- txtBorndate.Enabled = False
- comboClassno.Enabled = False
- txtRudate.Enabled = False
- txtTel.Enabled = False
- txtAddress.Enabled = False
- txtComment.Enabled = False
-
- mcclean = True
-
-
- End If
- End If
- End If
-
-
- End Sub