📄 danb.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form danb
BackColor = &H00800000&
Caption = "档案表"
ClientHeight = 6705
ClientLeft = 60
ClientTop = 345
ClientWidth = 9165
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 6705
ScaleWidth = 9165
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "检索"
Height = 375
Left = 6585
Style = 1 'Graphical
TabIndex = 8
Top = 6120
Width = 855
End
Begin VB.CommandButton sortCommand
Caption = "排序"
Height = 375
Left = 4140
Style = 1 'Graphical
TabIndex = 7
Top = 6120
Width = 855
End
Begin VB.CommandButton Command2
Caption = "查找"
Height = 375
Left = 5355
TabIndex = 6
Top = 6120
Width = 855
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 375
Left = 2925
TabIndex = 5
Top = 6120
Width = 855
End
Begin VB.CommandButton addcommand
Caption = "添加"
Height = 375
Left = 480
Style = 1 'Graphical
TabIndex = 4
Top = 6120
Width = 855
End
Begin VB.CommandButton exitcommand
Caption = "退出"
Height = 375
Left = 7800
Style = 1 'Graphical
TabIndex = 3
Top = 6120
Width = 855
End
Begin VB.CommandButton deletecommand
Caption = "删除"
Height = 375
Left = 1695
Style = 1 'Graphical
TabIndex = 2
Top = 6120
Width = 855
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\vb\学生档案管理系统.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 840
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "学生档案表"
Top = 120
Visible = 0 'False
Width = 1065
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "danb.frx":0000
Height = 4935
Left = 15
OleObjectBlob = "danb.frx":0014
TabIndex = 1
Top = 960
Width = 9135
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00800000&
Caption = "学生档案表"
BeginProperty Font
Name = "隶书"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFC0C0&
Height = 495
Left = 3360
TabIndex = 0
Top = 240
Width = 2400
End
End
Attribute VB_Name = "danb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub AddCommand_Click()
tjda.Command1.Visible = True
tjda.Command4.Visible = False
tjda.Show
Unload Me
End Sub
Private Sub Command1_Click()
tjda.Caption = "修改档案"
tjda.Label11.Caption = "请调整要修改的信息"
tjda.Text1.Text = danb.Data1.Recordset.Fields("学号")
tjda.Text2.Text = danb.Data1.Recordset.Fields("姓名")
tjda.Combo1.Text = danb.Data1.Recordset.Fields("性别")
tjda.Combo2.Text = danb.Data1.Recordset.Fields("院系")
tjda.Combo3.Text = danb.Data1.Recordset.Fields("政治面貌")
tjda.Text3.Text = danb.Data1.Recordset.Fields("出生日期")
tjda.Text4.Text = danb.Data1.Recordset.Fields("入学日期")
tjda.Text5.Text = danb.Data1.Recordset.Fields("备注")
tjda.Text6.Text = danb.Data1.Recordset.Fields("班级")
tjda.Command1.Visible = False
tjda.Command4.Visible = True
tjda.Show
End Sub
Private Sub Command2_Click()
chzhcht.Text1.Text = ""
chzhcht.Text2.Text = ""
chzhcht.Command1.Visible = False
chzhcht.Command2.Visible = False
chzhcht.Command3.Visible = False
chzhcht.Command4.Visible = False
chzhcht.Command5.Visible = False
chzhcht.Command6.Visible = False
chzhcht.Command7.Visible = True
chzhcht.Command8.Visible = True
chzhcht.Command9.Visible = True
chzhcht.Show
End Sub
Private Sub Command3_Click()
dachzh.Show
End Sub
Private Sub DeleteCommand_Click()
YesNo = MsgBox("真的要删除吗?", vbYesNo + vbQuestion + vbDefaultButton2)
If YesNo <> vbYes Then
Exit Sub
End If
If Data1.Recordset.RecordCount > 0 Then
Data1.Recordset.Delete
Data1.Recordset.MovePrevious
End If
End Sub
Private Sub ExitCommand_Click()
Unload Me
zhucht.Show
End Sub
Private Sub Form_Load()
Label1.Left = danb.Width / 2 - Label1.Width / 2
End Sub
Private Sub sortCommand_Click()
px.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -