📄 queuser.frm
字号:
VERSION 5.00
Begin VB.Form queUser
BorderStyle = 1 'Fixed Single
Caption = "查询用户信息"
ClientHeight = 3780
ClientLeft = 45
ClientTop = 330
ClientWidth = 6765
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3780
ScaleWidth = 6765
Begin VB.Frame Frame1
Caption = "注册用户信息"
Height = 1815
Left = 120
TabIndex = 6
ToolTipText = "已注册用户信息"
Top = 120
Width = 6495
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 1680
TabIndex = 12
Top = 360
Width = 1335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 4560
TabIndex = 11
Top = 360
Width = 1455
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 300
Left = 1680
TabIndex = 10
Top = 840
Width = 1335
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 4560
TabIndex = 9
Top = 840
Width = 1455
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 1680
TabIndex = 8
Top = 1320
Width = 1335
End
Begin VB.TextBox Text6
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 4560
TabIndex = 7
Top = 1320
Width = 1455
End
Begin VB.Label Label1
Caption = "用户姓名:"
Height = 255
Left = 360
TabIndex = 18
Top = 410
Width = 1095
End
Begin VB.Label Label2
Caption = "性别:"
Height = 255
Left = 3360
TabIndex = 17
Top = 410
Width = 975
End
Begin VB.Label Label3
Caption = "操作权限:"
Height = 255
Left = 360
TabIndex = 16
Top = 890
Width = 1095
End
Begin VB.Label Label4
Caption = "出生日期:"
Height = 255
Left = 3360
TabIndex = 15
Top = 890
Width = 1095
End
Begin VB.Label Label5
Caption = "参加工作时间:"
Height = 255
Left = 360
TabIndex = 14
Top = 1370
Width = 1335
End
Begin VB.Label Label6
Caption = "职称:"
Height = 255
Left = 3360
TabIndex = 13
Top = 1370
Width = 1095
End
End
Begin VB.Frame Frame2
Caption = "根据用户名进行查询"
Height = 975
Left = 120
TabIndex = 3
Top = 2040
Width = 6495
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3000
Style = 2 'Dropdown List
TabIndex = 4
Top = 360
Width = 2055
End
Begin VB.Label Label7
Caption = "请选择用户名:"
Height = 255
Left = 1320
TabIndex = 5
Top = 400
Width = 1335
End
End
Begin VB.CommandButton Command1
Caption = "清空查询(&C)"
Height = 375
Left = 600
TabIndex = 2
Top = 3240
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "执行查询(&Q)"
Height = 375
Left = 2760
TabIndex = 1
Top = 3240
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "返回(&B)"
Height = 375
Left = 4920
TabIndex = 0
Top = 3240
Width = 1215
End
End
Attribute VB_Name = "queUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim txtSQL As String
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Clear
txtSQL = "select username from userLogin WHERE SystemName='Student'"
Call Module1.DataList(txtSQL, Combo1)
End Sub
Private Sub Command2_Click()
Dim txtSQL As String
Dim MRC As ADODB.Recordset
Dim MsgText As String
Dim sMeg As String
If (Combo1.Text = "") Then
MsgBox "请选择用户名,以便进行查询!", vbOKOnly + vbExclamation, "成绩管理系统"
Combo1.Enabled = True
Exit Sub
Else
txtSQL = "SELECT userinfo.name,userinfo.sex,userLogin.Authority,userinfo.birthdate,userinfo.entryyear,userinfo.rank FROM userLogin, userinfo Where userinfo.userID = userLogin.userID AND username='" & Combo1.Text & "' AND SystemName='Student'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
Text1.Text = Trim(MRC.Fields(0).Value)
Text2.Text = Trim(MRC.Fields(1).Value)
Text3.Text = Trim(MRC.Fields(2).Value)
Text4.Text = Trim(MRC.Fields(3).Value)
Text5.Text = Trim(MRC.Fields(4).Value)
Text6.Text = Trim(MRC.Fields(5).Value)
MRC.Close
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim txtSQL As String
Dim MRC As ADODB.Recordset
Dim MsgText As String
Me.Move (frmMain.ScaleWidth - Me.Width) / 2, (frmMain.ScaleHeight - Me.Height) / 2
txtSQL = "SELECT * FROM userLogin WHERE SystemName='Student'"
Set MRC = ExecuteSQL(txtSQL, MsgText)
If (MRC.EOF) Then
MsgBox "所要进行查询的表中无数据!", vbOKOnly + vbCritical, "警告"
Command2.Enabled = False
Command3.Enabled = False
End If
txtSQL = "select username from userLogin WHERE SystemName='Student'"
Call Module1.DataList(txtSQL, Combo1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -