📄 dacz.frm
字号:
Height = 315
Left = 6600
TabIndex = 39
Text = "Text16"
Top = 300
Width = 1005
End
Begin VB.TextBox Text5
Height = 315
Left = 3780
TabIndex = 5
Text = "Text5"
Top = 780
Width = 1095
End
Begin VB.TextBox Text4
Height = 315
Left = 1020
TabIndex = 4
Text = "Text4"
Top = 1320
Width = 1875
End
Begin VB.TextBox Text3
Height = 315
Left = 780
TabIndex = 3
Text = "Text3"
Top = 780
Width = 1935
End
Begin VB.TextBox Text2
Height = 315
Left = 3780
TabIndex = 2
Text = "Text2"
Top = 300
Width = 1815
End
Begin VB.TextBox Text1
Height = 315
Left = 780
TabIndex = 1
Text = "Text1"
Top = 300
Width = 2055
End
Begin VB.Label Label7
Caption = "血型"
Height = 315
Left = 3120
TabIndex = 11
Top = 840
Width = 555
End
Begin VB.Label Label6
Caption = "出生日期"
Height = 315
Left = 120
TabIndex = 10
Top = 1380
Width = 855
End
Begin VB.Label Label5
Caption = "民族"
Height = 315
Left = 120
TabIndex = 9
Top = 840
Width = 555
End
Begin VB.Label Label16
Caption = "性别"
Height = 315
Left = 6060
TabIndex = 8
Top = 360
Width = 555
End
Begin VB.Label Label17
Caption = "姓名"
Height = 315
Left = 3120
TabIndex = 7
Top = 360
Width = 555
End
Begin VB.Label Label18
Caption = "学号"
Height = 315
Left = 120
TabIndex = 6
Top = 360
Width = 435
End
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "档 案 查 找"
BeginProperty Font
Name = "黑体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 0
TabIndex = 38
Top = 0
Width = 7905
End
End
Attribute VB_Name = "档案查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mrc As ADODB.Recordset
Private Sub Command1_Click()
If Text14.Text = "" Then
MsgBox " 输入查找学号!", vbExclamation + vbOKOnly, "警告"
Text14.SetFocus
Exit Sub
End If
If Text15.Text = "" Then
MsgBox " 输入查找姓名!", vbExclamation + vbOKOnly, "警告"
Text15.SetFocus
Exit Sub
End If
txtsql = "select a.学号,a.姓名,a.性别,a.民族,a.血型,a.出生年月,b.院系名称,c.专业名称,d.班级名称,a.联系电话,a.邮编,a.籍贯,a.家庭住址,a.备注 from 学生基本信息 a,院系 b,专业 c,班级 d where a.院系代码=b.院系代码 and a.专业代码=c.专业代码 and a.班级代码=d.班级代码 and a.学号='" & Trim(Text14.Text) & "' and a.姓名='" & Trim(Text15.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If Not mrc.EOF Then
Me.fz
Me.sz
Else
MsgBox " 不存在该档案!", vbExclamation + vbOKOnly, "警告"
Text14.SetFocus
Exit Sub
End If
Text14.Text = ""
Text15.Text = ""
mrc.Close
'使用一组按钮,不是按某一个值来查找
txtsql = "select a.学号,a.姓名,a.性别,a.民族,a.血型,a.出生年月,b.院系名称,c.专业名称,d.班级名称,a.联系电话,a.邮编,a.籍贯,a.家庭住址,a.备注 from 学生基本信息 a,院系 b,专业 c,班级 d where a.院系代码=b.院系代码 and a.专业代码=c.专业代码 and a.班级代码=d.班级代码 "
Set mrc = ExecuteSQL(txtsql)
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
'txtsql = "select a.学号,a.姓名,a.性别,a.民族,a.血型,a.出生年月,b.院系名称,c.专业名称,d.班级名称,a.联系电话,a.邮编,a.籍贯,a.家庭住址,a.备注 from 学生基本信息 a,院系 b,专业 c,班级 d where a.院系代码=b.院系代码 and a.专业代码=c.专业代码 and a.班级代码=d.班级代码 "
'Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
Me.fz
'mrc.Close
End Sub
Private Sub Command4_Click()
'txtsql = "select a.学号,a.姓名,a.性别,a.民族,a.血型,a.出生年月,b.院系名称,c.专业名称,d.班级名称,a.联系电话,a.邮编,a.籍贯,a.家庭住址,a.备注 from 学生基本信息 a,院系 b,专业 c,班级 d where a.院系代码=b.院系代码 and a.专业代码=c.专业代码 and a.班级代码=d.班级代码 "
'Set mrc = ExecuteSQL(txtsql)
mrc.MovePrevious
If mrc.BOF Then
mrc.MoveFirst
MsgBox " 到第一条记录!", vbExclamation + vbOKOnly, "提示"
End If
Me.fz
'mrc.Close
End Sub
Private Sub Command5_Click()
'txtsql = "select a.学号,a.姓名,a.性别,a.民族,a.血型,a.出生年月,b.院系名称,c.专业名称,d.班级名称,a.联系电话,a.邮编,a.籍贯,a.家庭住址,a.备注 from 学生基本信息 a,院系 b,专业 c,班级 d where a.院系代码=b.院系代码 and a.专业代码=c.专业代码 and a.班级代码=d.班级代码 "
'Set mrc = ExecuteSQL(txtsql)
mrc.MoveNext
If mrc.EOF Then
mrc.MoveLast
MsgBox " 到最后一条记录!", vbExclamation + vbOKOnly, "提示"
End If
Me.fz
'mrc.Close
End Sub
Private Sub Command6_Click()
'txtsql = "select a.学号,a.姓名,a.性别,a.民族,a.血型,a.出生年月,b.院系名称,c.专业名称,d.班级名称,a.联系电话,a.邮编,a.籍贯,a.家庭住址,a.备注 from 学生基本信息 a,院系 b,专业 c,班级 d where a.院系代码=b.院系代码 and a.专业代码=c.专业代码 and a.班级代码=d.班级代码 "
'Set mrc = ExecuteSQL(txtsql)
mrc.MoveLast
Me.fz
'mrc.Close
End Sub
Private Sub Form_Load()
Me.qk
Me.sz
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
End Sub
Public Sub qk()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
End Sub
Public Sub sz()
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Text8.Enabled = False
Text9.Enabled = False
Text10.Enabled = False
Text11.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Text16.Enabled = False
End Sub
Public Sub fz()
Text1.Text = mrc.Fields(0)
Text2.Text = mrc.Fields(1)
Text16.Text = mrc.Fields(2)
Text3.Text = mrc.Fields(3)
Text5.Text = mrc.Fields(4)
Text4.Text = mrc.Fields(5)
Text6.Text = mrc.Fields(6)
Text7.Text = mrc.Fields(7)
Text8.Text = mrc.Fields(8)
Text9.Text = mrc.Fields(9)
Text10.Text = mrc.Fields(10)
Text11.Text = mrc.Fields(11)
Text12.Text = mrc.Fields(12)
Text13.Text = mrc.Fields(13)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -