📄 frmstuman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmStuMan
Caption = "学生管理"
ClientHeight = 7650
ClientLeft = 60
ClientTop = 450
ClientWidth = 9645
LinkTopic = "Form1"
ScaleHeight = 7650
ScaleWidth = 9645
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command5
Caption = "尾项"
Height = 495
Left = 8520
TabIndex = 10
Top = 3360
Width = 855
End
Begin VB.CommandButton Command4
Caption = "下一项"
Height = 495
Left = 8520
TabIndex = 9
Top = 2520
Width = 855
End
Begin VB.CommandButton Command3
Caption = "上一项"
Height = 495
Left = 8520
TabIndex = 8
Top = 1680
Width = 855
End
Begin VB.CommandButton Command2
Caption = "首项"
Height = 495
Left = 8520
TabIndex = 7
Top = 840
Width = 855
End
Begin VB.CommandButton Cmd_view
Caption = "查看"
Height = 495
Left = 5760
TabIndex = 6
Top = 6600
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "返回"
Height = 495
Left = 6960
TabIndex = 5
Top = 6600
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 450
Left = 7080
Top = 7200
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 794
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
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=F:\学习资料\学生信息管理系统\学生成绩.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\学习资料\学生信息管理系统\学生成绩.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Students"
Caption = "学生基本信息管理"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Cmd_update
Caption = "更新"
Height = 495
Left = 4560
TabIndex = 4
Top = 6600
Width = 1215
End
Begin VB.CommandButton Cmd_Modi
Caption = "修改"
Height = 495
Left = 3360
TabIndex = 3
Top = 6600
Width = 1215
End
Begin VB.CommandButton Cmd_del
Caption = "删除"
Height = 495
Left = 2160
TabIndex = 2
Top = 6600
Width = 1215
End
Begin VB.CommandButton Cmd_add
Caption = "添加"
Height = 495
Left = 960
TabIndex = 1
Top = 6600
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmStuMan.frx":0000
Height = 6135
Left = 0
TabIndex = 0
Top = 360
Width = 8295
_ExtentX = 14631
_ExtentY = 10821
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Attribute VB_Name = "FrmStuMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Private Sub RefreshData()
'设置ADO控件的连接字符串
' Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
' + App.Path + "\学生成绩.mdb;Persist Security Info=False"
'设置数据源
'Adodc1.RecordSource = "SELECT Student_Id As 学生编号, Student_Name As 学生姓名, Sex As 性别 FROM Students" _
' + " WHERE Student_Id=" + Trim(Str(Student_Id))
'Adodc1.Refresh
'设置列宽度
' With DataGrid1
' .Columns(0).Width = 1200
' .Columns(1).Width = 1200
' .Columns(2).Width = 1200
' .Columns(3).Width = 1200
'.Columns(4).Width = 2700
' .Columns(5).Width = 2800
' End With
'End Sub
Private Sub Cmd_Add_Click()
FrmStuAdd.Show '调用学生信息编辑窗体
End Sub
Private Sub Cmd_Del_Click()
Dim TmpStudent_Id As Long
If Adodc1.Recordset.BOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
TmpStudent_Id = Adodc1.Recordset.Fields(0)
If MsgBox("是否删除当前行?", vbYesNo, "确认") = vbYes Then
Call MyStu.DeleteByStudent_Id(TmpStudent_Id)
Adodc1.Refresh
End If
End Sub
Private Sub Cmd_Modi_Click()
With FrmStuEdit
.txtStu_Name = Adodc1.Recordset.Fields(1) '姓名
.ComboSex = Adodc1.Recordset.Fields(2) '性别
.txtNationality = Adodc1.Recordset.Fields(3) '民族
.txtBirth = Adodc1.Recordset.Fields(4) '出生日期
.txtFamily_place = Adodc1.Recordset.Fields(5) '籍贯
.txtId_Card = Adodc1.Recordset.Fields(6) '身份证号
.txtBadgeID = Adodc1.Recordset.Fields(7) '学生证号
.txtHomePhone = Adodc1.Recordset.Fields(8) '家庭电话
.txtResidence = Adodc1.Recordset.Fields(9) '居住地址
.txtPostcode = Adodc1.Recordset.Fields(10) '邮政编码
.txtInDate = Adodc1.Recordset.Fields(11) '入校日期
.txtClass_ID = Adodc1.Recordset.Fields(12) '班级编号
.txtTitle = Adodc1.Recordset.Fields(13) '职务
End With
FrmStuEdit.Show
End Sub
Private Sub Cmd_Update_Click()
Adodc1.Refresh
End Sub
Private Sub Cmd_view_Click()
With FrmStuView
.txtStu_Name = Adodc1.Recordset.Fields(1) '姓名
.ComboSex = Adodc1.Recordset.Fields(2) '性别
.txtNationality = Adodc1.Recordset.Fields(3) '民族
.txtBirth = Adodc1.Recordset.Fields(4) '出生日期
.txtFamily_place = Adodc1.Recordset.Fields(5) '籍贯
.txtId_Card = Adodc1.Recordset.Fields(6) '身份证号
.txtBadgeID = Adodc1.Recordset.Fields(7) '学生证号
.txtHomePhone = Adodc1.Recordset.Fields(8) '家庭电话
.txtResidence = Adodc1.Recordset.Fields(9) '居住地址
.txtPostcode = Adodc1.Recordset.Fields(10) '邮政编码
.txtInDate = Adodc1.Recordset.Fields(11) '入校日期
.txtClass_ID = Adodc1.Recordset.Fields(12) '班级编号
.txtTitle = Adodc1.Recordset.Fields(13) '职务
End With
FrmStuView.Show
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MovePrevious
End If
End Sub
Private Sub Command4_Click()
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.MoveNext
End If
End Sub
Private Sub Command5_Click()
Adodc1.Recordset.MoveLast
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -