📄 frmxjmodify.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmxjmodify
Caption = "修改学籍信息"
ClientHeight = 5775
ClientLeft = 60
ClientTop = 345
ClientWidth = 7470
LinkTopic = "Form1"
ScaleHeight = 5775
ScaleWidth = 7470
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command8
Caption = "退出"
Height = 435
Left = 5640
TabIndex = 25
Top = 5100
Width = 1155
End
Begin VB.CommandButton Command7
Caption = "删除记录"
Height = 435
Left = 3900
TabIndex = 24
Top = 5130
Width = 1155
End
Begin VB.CommandButton Command6
Caption = "取消更新"
Height = 435
Left = 2160
TabIndex = 23
Top = 5130
Width = 1155
End
Begin VB.CommandButton Command5
Caption = "更新记录"
Height = 435
Left = 420
TabIndex = 22
Top = 5130
Width = 1155
End
Begin VB.CommandButton Command4
Caption = "最后一条"
Height = 465
Left = 5610
TabIndex = 21
Top = 4440
Width = 1155
End
Begin VB.CommandButton Command3
Caption = "下一条"
Height = 465
Left = 3880
TabIndex = 20
Top = 4440
Width = 1155
End
Begin VB.CommandButton Command2
Caption = "上一条"
Height = 465
Left = 2150
TabIndex = 19
Top = 4440
Width = 1155
End
Begin VB.CommandButton Command1
Caption = "第一条"
Height = 465
Left = 420
TabIndex = 18
Top = 4440
Width = 1155
End
Begin MSAdodcLib.Adodc Adodc1
Height = 525
Left = 3030
Top = 2700
Visible = 0 'False
Width = 1905
_ExtentX = 3360
_ExtentY = 926
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\student_MIS\studentinfo.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\student_MIS\studentinfo.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "student_info"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text8
DataField = "comment"
DataSource = "Adodc1"
Height = 465
Left = 1320
TabIndex = 8
Text = "Text8"
Top = 3720
Width = 5745
End
Begin VB.TextBox Text7
DataField = "address"
DataSource = "Adodc1"
Height = 465
Left = 1320
TabIndex = 7
Text = "Text7"
Top = 3090
Width = 5715
End
Begin VB.TextBox Text6
DataField = "telephone"
DataSource = "Adodc1"
Height = 465
Left = 1320
TabIndex = 6
Text = "Text6"
Top = 2370
Width = 5715
End
Begin VB.TextBox Text5
DataField = "classname"
DataSource = "Adodc1"
Height = 465
Left = 1320
TabIndex = 5
Text = "Text5"
Top = 1680
Width = 1815
End
Begin VB.ComboBox Combo1
DataField = "student_sex"
DataSource = "Adodc1"
Height = 315
ItemData = "frmxjmodify.frx":0000
Left = 1320
List = "frmxjmodify.frx":000A
Style = 2 'Dropdown List
TabIndex = 4
Top = 990
Width = 1575
End
Begin VB.TextBox Text4
DataField = "enroll_date"
DataSource = "Adodc1"
Height = 495
Left = 5250
TabIndex = 3
Text = "Text4"
Top = 1620
Width = 1785
End
Begin VB.TextBox Text3
DataField = "born_date"
DataSource = "Adodc1"
Height = 495
Left = 5250
TabIndex = 2
Text = "Text3"
Top = 960
Width = 1785
End
Begin VB.TextBox Text2
DataField = "student_name"
DataSource = "Adodc1"
Height = 495
Left = 5250
TabIndex = 1
Text = "Text2"
Top = 300
Width = 1785
End
Begin VB.TextBox Text1
DataField = "student_ID"
DataSource = "Adodc1"
Height = 465
Left = 1320
Locked = -1 'True
TabIndex = 0
Text = "Text1"
Top = 300
Width = 1755
End
Begin VB.Label Label9
Caption = "入学时间:"
Height = 465
Left = 3810
TabIndex = 17
Top = 1620
Width = 1425
End
Begin VB.Label Label8
Caption = "出生日期:"
Height = 465
Left = 3810
TabIndex = 16
Top = 960
Width = 1425
End
Begin VB.Label Label7
Caption = "姓名:"
Height = 435
Left = 3810
TabIndex = 15
Top = 330
Width = 1425
End
Begin VB.Label Label6
Caption = "备注:"
Height = 465
Left = 390
TabIndex = 14
Top = 3750
Width = 915
End
Begin VB.Label Label5
Caption = "地址:"
Height = 465
Left = 390
TabIndex = 13
Top = 3060
Width = 915
End
Begin VB.Label Label4
Caption = "电话:"
Height = 465
Left = 390
TabIndex = 12
Top = 2370
Width = 915
End
Begin VB.Label Label3
Caption = "班级:"
Height = 465
Left = 390
TabIndex = 11
Top = 1680
Width = 915
End
Begin VB.Label Label2
Caption = "性别:"
Height = 465
Left = 390
TabIndex = 10
Top = 990
Width = 915
End
Begin VB.Label Label1
Caption = "学号:"
Height = 465
Left = 390
TabIndex = 9
Top = 300
Width = 915
End
End
Attribute VB_Name = "frmxjmodify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'指针移到第一条记录
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command2_Click()
'指针移到上一条记录,如果记录指针移到BOF,则记录指针指到第一条,并给出提示
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveFirst
MsgBox "已到第一条记录!"
End If
End Sub
Private Sub Command3_Click()
'指针移到下一条,如果记录指针移到EOF,则记录指针指到最后一条,并给出提示
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox "已到最后一条记录"
End If
End Sub
Private Sub Command4_Click()
'记录指针指到最后一条
Adodc1.Recordset.MoveLast
End Sub
Private Sub Command5_Click()
'更新当前记录
Dim bookmark As Variant '定义书签,记录当前记录的位置
bookmark = Adodc1.Recordset.bookmark
If Trim(Text2.Text) = "" Then '判断修改后的姓名是否为空
MsgBox "姓名不能为空!", vbOKOnly, "警告"
Adodc1.Refresh '数据库中的数据刷新文本框
Adodc1.Recordset.bookmark = bookmark '回到要修改记录位置
Text2.SetFocus
Exit Sub
End If
If Not IsDate(Text3.Text) Then '判断修改后是日期是否为正确格式
MsgBox "出生日期格式不对!", vbOKOnly, "警告"
Adodc1.Refresh
Adodc1.Recordset.bookmark = bookmark
Text3.SetFocus
Exit Sub
End If
If Trim(Text5.Text) = "" Then '判断修改后的班级信息是否为空
MsgBox "班级信息不能为空!", vbOKOnly, "警告"
Adodc1.Refresh
Adodc1.Recordset.bookmark = bookmark
Text5.SetFocus
Exit Sub
End If
If Not IsDate(Text4.Text) Then '判断修改后是日期是否为正确格式
MsgBox "入学时间格式不对!", vbOKOnly, "警告"
Adodc1.Refresh
Adodc1.Recordset.bookmark = bookmark
Text4.SetFocus
Exit Sub
End If
'更新当前记录
Adodc1.Recordset.Update
MsgBox "当前记录已更新!", vbOKOnly, "提示"
End Sub
Private Sub Command7_Click()
'删除当前记录
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveFirst
MsgBox "当前记录已删除!", vbOKOnly, "提示"
End Sub
Private Sub Command8_Click()
Unload Me
End Sub
Private Sub Command6_Click()
'取消更新
Dim bookmark As Variant
bookmark = Adodc1.Recordset.bookmark
Adodc1.Refresh
Adodc1.Recordset.bookmark = bookmark
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -