📄 frmqury.frm
字号:
VERSION 5.00
Begin VB.Form FrmQury
BackColor = &H00FFC0C0&
Caption = "查询学生基本信息"
ClientHeight = 4110
ClientLeft = 60
ClientTop = 345
ClientWidth = 5925
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4110
ScaleWidth = 5925
StartUpPosition = 2 '屏幕中心
Begin VB.CheckBox NameCheck
BackColor = &H00FFC0C0&
Caption = "姓名"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 495
Left = 960
TabIndex = 7
Top = 1920
Width = 855
End
Begin VB.CheckBox NoCheck
BackColor = &H00FFC0C0&
Caption = "学号"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 375
Left = 960
TabIndex = 6
Top = 1200
Width = 975
End
Begin VB.CommandButton Command2
BackColor = &H00FFC0C0&
Caption = "退出"
BeginProperty Font
Name = "华文行楷"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
Style = 1 'Graphical
TabIndex = 5
Top = 3000
Width = 1215
End
Begin VB.CommandButton cmdfind
BackColor = &H00FFC0C0&
Caption = "查询"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
Style = 1 'Graphical
TabIndex = 4
Top = 3000
Width = 1095
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "查询条件"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 2055
Left = 720
TabIndex = 1
Top = 720
Width = 4455
Begin VB.TextBox NameEdit
BackColor = &H00FFC0C0&
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 375
Left = 1680
TabIndex = 3
Top = 1200
Width = 2175
End
Begin VB.TextBox NoEdit
BackColor = &H00FFC0C0&
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 375
Left = 1680
TabIndex = 2
Top = 360
Width = 2175
End
End
Begin VB.Label Topic
BackColor = &H00FFC0C0&
Caption = "请选择输入查询的条件"
BeginProperty Font
Name = "华文行楷"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 375
Left = 1680
TabIndex = 0
Top = 240
Width = 3015
End
End
Attribute VB_Name = "FrmQury"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdfind_Click()
Dim sql As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
sql = "select * from SelectCourse where (1=1) "
If Trim(NoEdit.Text) = "" And Trim(NameEdit.Text) = "" Then
MsgBox "请选择你要查询的条件并输入你要查询的内容!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
If (NoCheck.Value) And (NoEdit.Text <> "") Then
sql = "select * from Student "
sql = sql & " where Sno = '" & Trim(NoEdit.Text) & " '"
Set rs = TransactSQL(sql)
End If
If (NameCheck.Value) And (NameEdit.Text <> "") Then
sql = "select * from Student "
sql = sql & " where Sname like '%" & Trim(NameEdit.Text) & "%'"
Set rs = TransactSQL(sql)
End If
End If
If rs.EOF Then
MsgBox "Sorry,无法找到你要想查询的学生的基本信息!"
Else
FrmInfo_Student.Text1.Text = rs("Sno")
FrmInfo_Student.Text2.Text = rs("Sname")
FrmInfo_Student.Text3.Text = rs("Ssex")
FrmInfo_Student.Text4.Text = rs("Sage")
FrmInfo_Student.Text5.Text = rs("Splace")
FrmInfo_Student.Text6.Text = rs("Spolity")
FrmInfo_Student.Text7.Text = rs("Stime")
FrmInfo_Student.Text8.Text = rs("Steleph")
FrmInfo_Student.Show
End If
rs.Close
Set rs = Nothing
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub NameCheck_Click()
NameEdit.Enabled = NameCheck.Value
End Sub
Private Sub NoCheck_Click()
NoEdit.Enabled = NoCheck.Value
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -