📄 班级查询.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Begin VB.Form Frm_FindClass
BorderStyle = 1 'Fixed Single
Caption = "班级查询"
ClientHeight = 5730
ClientLeft = 45
ClientTop = 330
ClientWidth = 9480
Icon = "班级查询.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5730
ScaleWidth = 9480
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1080
Top = 5160
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 582
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=信息.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 班级表"
Caption = "Adodc1"
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.Frame Frame1
Height = 4215
Left = 120
TabIndex = 2
Top = 480
Width = 9255
Begin VB.OptionButton Option2
Caption = "OR"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5640
TabIndex = 16
Top = 3480
Width = 735
End
Begin VB.OptionButton Option1
Caption = "AND"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3120
TabIndex = 15
Top = 3480
Width = 975
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7320
TabIndex = 14
Text = "Text2"
Top = 2280
Width = 1695
End
Begin VB.ComboBox Combo4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 4920
TabIndex = 12
Text = "Combo4"
Top = 2280
Width = 855
End
Begin VB.ComboBox Combo3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1440
TabIndex = 10
Text = "Combo3"
Top = 2280
Width = 1815
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7320
TabIndex = 8
Text = "Text1"
Top = 1080
Width = 1695
End
Begin VB.ComboBox Combo2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 4920
TabIndex = 6
Text = "Combo2"
Top = 1080
Width = 855
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1440
TabIndex = 4
Text = "Combo1"
Top = 1080
Width = 1815
End
Begin VB.Label Label6
Caption = "条件2:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6600
TabIndex = 13
Top = 2400
Width = 735
End
Begin VB.Label Label5
Caption = "运算符:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4080
TabIndex = 11
Top = 2400
Width = 855
End
Begin VB.Label Label4
Caption = "查询类别2:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 9
Top = 2400
Width = 1215
End
Begin VB.Label Label3
Caption = "条件1:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6600
TabIndex = 7
Top = 1200
Width = 735
End
Begin VB.Label Label2
Caption = "运算符:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4080
TabIndex = 5
Top = 1200
Width = 855
End
Begin VB.Label Label1
Caption = "查询类别1:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 1200
Width = 1215
End
End
Begin VB.CommandButton Command3
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7920
TabIndex = 1
Top = 4920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "查询"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6120
TabIndex = 0
Top = 4920
Width = 1215
End
End
Attribute VB_Name = "Frm_FindClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim a As String
Dim BJCX1 As String
Dim BJCX2 As String
a = Trim(Combo2)
Select Case a
Case "="
BJCX1 = "" & Combo1.Text & " " & Combo2.Text & " '" & Trim(Text1) & "'"
Case "like"
BJCX1 = "Instr(1," & Combo1.Text & ",'" & Trim(Text1.Text) & "')<>0 "
End Select
a = Trim(Combo4)
Select Case a
Case "="
BJCX2 = "" & Combo3.Text & " " & Combo4.Text & " '" & Trim(Text2) & "'"
Case "like"
BJCX2 = "Instr(1," & Combo3.Text & ",'" & Trim(Text2.Text) & "')<>0 "
End Select
If Option1.Value = True Then
If BJCX1 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX2
ElseIf BJCX2 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX1
Else
strTiaoJian = "select * from 班级表 where " & BJCX1 & "and " & BJCX2
End If
ElseIf Option2.Value = True Then
If BJCX1 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX2
ElseIf BJCX2 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX1
Else
strTiaoJian = "select * from 班级表 where " & BJCX1 & "or " & BJCX2
End If
Else
If BJCX1 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX2
ElseIf BJCX2 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX1
Else
MsgBox "请选择连接方式!", vbOKOnly, "警告"
Exit Sub
End If
End If
If (BJCX1 & BJCX2) = "" Then
MsgBox "请输入查询类别!", vbOKOnly, "警告"
Exit Sub
Else
Unload Me
Frm_UpdateClass.Show 1
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;Persist Security Info=False"
Combo1.AddItem ("年级")
Combo1.AddItem ("专业")
Combo1.AddItem ("人数")
Combo1.AddItem ("辅导员")
Combo2.AddItem ("=")
Combo3.AddItem ("年级")
Combo3.AddItem ("专业")
Combo3.AddItem ("人数")
Combo3.AddItem ("辅导员")
Combo4.AddItem ("=")
Combo1.Text = ""
Combo2.Text = ""
Text1.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -