📄 formdel.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form FormDel
BorderStyle = 3 'Fixed Dialog
Caption = "基本信息查询"
ClientHeight = 5985
ClientLeft = 4215
ClientTop = 2130
ClientWidth = 10710
Icon = "FormDel.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5985
ScaleWidth = 10710
ShowInTaskbar = 0 'False
Visible = 0 'False
Begin VB.TextBox Text3
Height = 300
Left = 7920
TabIndex = 11
Top = 600
Visible = 0 'False
Width = 2055
End
Begin VB.TextBox Text2
Height = 300
Left = 4680
TabIndex = 9
Top = 600
Visible = 0 'False
Width = 2055
End
Begin VB.OptionButton Option3
Caption = "输入班号查询"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6960
TabIndex = 8
Top = 120
Width = 2535
End
Begin VB.OptionButton Option2
Caption = "输入专业查询"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3720
TabIndex = 7
Top = 120
Width = 2295
End
Begin VB.OptionButton Option1
Caption = "输入学号查询"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 6
Top = 120
Value = -1 'True
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "查 询"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6000
TabIndex = 2
Top = 5400
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "打 印"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8640
TabIndex = 3
Top = 5400
Width = 1695
End
Begin VB.Frame Frame1
Caption = "结 果"
Height = 4215
Left = 120
TabIndex = 4
Top = 1080
Width = 10335
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 3855
Left = 120
TabIndex = 5
Top = 240
Width = 9975
_ExtentX = 17595
_ExtentY = 6800
_Version = 393216
Cols = 18
BackColorBkg = -2147483639
End
End
Begin VB.TextBox Text1
Height = 300
Left = 1320
TabIndex = 1
Top = 600
Width = 2055
End
Begin VB.Label Label3
Caption = "班 号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6960
TabIndex = 12
Top = 600
Visible = 0 'False
Width = 1095
End
Begin VB.Label Label2
Caption = "专 业:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3720
TabIndex = 10
Top = 600
Visible = 0 'False
Width = 1095
End
Begin VB.Label Label1
Caption = "学 号:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 600
Width = 1095
End
End
Attribute VB_Name = "FormDel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mrc As ADODB.Recordset
Dim txtSQL As String
Dim Msgtext As String
Private Sub Command2_Click()
If Option1.Value = True Then
If Not IsNumeric(Text1) Then
MsgBox "学号输入有误!", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
txtSQL = "select * from 基本信息 where 学号='" & Trim(Text1.Text) & "'"
Set Mrc = ExecuteSQL(txtSQL, Msgtext)
If Mrc.EOF = True Then
MsgBox "无此学号!", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
Else
If Option2.Value = True Then
If Text2.Text = "" Then
MsgBox "专业不可为空!", vbOKOnly + vbExclamation, "提示"
Text2.SetFocus
Exit Sub
End If
txtSQL = "select * from 基本信息 where 专业='" & Trim(Text2.Text) & "'"
Set Mrc = ExecuteSQL(txtSQL, Msgtext)
If Mrc.EOF = True Then
MsgBox "无此专业!", vbOKOnly + vbExclamation, "提示"
Text2.SetFocus
Exit Sub
End If
Else
If Text3.Text = "" Then
MsgBox "班号不能为空!", vbOKOnly + vbExclamation, "提示"
Text3.SetFocus
Exit Sub
End If
txtSQL = "select * from 基本信息 where 班号='" & Trim(Text3.Text) & "'"
Set Mrc = ExecuteSQL(txtSQL, Msgtext)
If Mrc.EOF = True Then
MsgBox "无此班级!", vbOKOnly + vbExclamation, "提示"
Text3.SetFocus
Exit Sub
End If
End If
End If
With MSFlexGrid1
.ColWidth(0) = 2000
.ColWidth(1) = 1200
.ColWidth(2) = 2500
.ColWidth(3) = 1200
.ColWidth(4) = 1200
.ColWidth(5) = 1000
.ColWidth(6) = 1500
.ColWidth(7) = 1200
.ColWidth(8) = 1200
.ColWidth(9) = 1200
.ColWidth(10) = 2000
.ColWidth(11) = 3000
.ColWidth(12) = 1200
.ColWidth(13) = 2000
.ColWidth(14) = 1200
.ColWidth(15) = 3000
.ColWidth(16) = 3000
.ColWidth(17) = 2000
.TextMatrix(0, 0) = "学号"
.TextMatrix(0, 1) = "系名"
.TextMatrix(0, 2) = "专业"
.TextMatrix(0, 3) = "班号"
.TextMatrix(0, 4) = "姓名"
.TextMatrix(0, 5) = "性别"
.TextMatrix(0, 6) = "民族"
.TextMatrix(0, 7) = "曾用名"
.TextMatrix(0, 8) = "政治面貌"
.TextMatrix(0, 9) = "本人成分"
.TextMatrix(0, 10) = "出生日期"
.TextMatrix(0, 11) = "考生来源"
.TextMatrix(0, 12) = "家庭出身"
.TextMatrix(0, 13) = "家庭电话"
.TextMatrix(0, 14) = "家庭邮编"
.TextMatrix(0, 15) = "籍贯"
.TextMatrix(0, 16) = "家庭住址"
.TextMatrix(0, 17) = "备注"
.Rows = 1
Do While Not Mrc.EOF
.Rows = .Rows + 1
For i = 0 To Mrc.Fields.Count - 1
.TextMatrix(.Rows - 1, i) = Mrc.Fields(i) & ""
Next i
Mrc.MoveNext
Loop
End With
Mrc.Close
End Sub
Private Sub ShowData()
Dim txSQL As String
Dim Mrcc As ADODB.Recordset
txSQL = "select * from 基本信息"
Set Mrcc = ExecuteSQL(txSQL, Msgtext)
With MSFlexGrid1
.ColWidth(0) = 2000
.ColWidth(1) = 1200
.ColWidth(2) = 2500
.ColWidth(3) = 1200
.ColWidth(4) = 1200
.ColWidth(5) = 1000
.ColWidth(6) = 1500
.ColWidth(7) = 1200
.ColWidth(8) = 1200
.ColWidth(9) = 1200
.ColWidth(10) = 2000
.ColWidth(11) = 3000
.ColWidth(12) = 1200
.ColWidth(13) = 2000
.ColWidth(14) = 1200
.ColWidth(15) = 3000
.ColWidth(16) = 3000
.ColWidth(17) = 2000
.TextMatrix(0, 0) = "学号"
.TextMatrix(0, 1) = "系名"
.TextMatrix(0, 2) = "专业"
.TextMatrix(0, 3) = "班号"
.TextMatrix(0, 4) = "姓名"
.TextMatrix(0, 5) = "性别"
.TextMatrix(0, 6) = "民族"
.TextMatrix(0, 7) = "曾用名"
.TextMatrix(0, 8) = "政治面貌"
.TextMatrix(0, 9) = "本人成分"
.TextMatrix(0, 10) = "出生日期"
.TextMatrix(0, 11) = "考生来源"
.TextMatrix(0, 12) = "家庭出身"
.TextMatrix(0, 13) = "家庭电话"
.TextMatrix(0, 14) = "家庭邮编"
.TextMatrix(0, 15) = "籍贯"
.TextMatrix(0, 16) = "家庭住址"
.TextMatrix(0, 17) = "备注"
.Rows = 1
Do While Not Mrcc.EOF
.Rows = .Rows + 1
For i = 0 To Mrcc.Fields.Count - 1
.TextMatrix(.Rows - 1, i) = Mrcc.Fields(i) & ""
Next i
Mrcc.MoveNext
Loop
End With
Mrcc.Close
End Sub
Private Sub Form_Load()
ShowData
End Sub
Private Sub Option1_Click()
Label1.Visible = True
Label2.Visible = False
Label3.Visible = False
Text1.Visible = True
Text2.Visible = False
Text3.Visible = False
End Sub
Private Sub Option2_Click()
Label2.Visible = True
Label1.Visible = False
Label3.Visible = False
Text2.Visible = True
Text1.Visible = False
Text3.Visible = False
End Sub
Private Sub Option3_Click()
Label3.Visible = True
Label2.Visible = False
Label1.Visible = False
Text3.Visible = True
Text2.Visible = False
Text1.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -