📄 frmuser_up.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomct2.ocx"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frmUser_up
BorderStyle = 3 'Fixed Dialog
Caption = "操作员停用管理"
ClientHeight = 5835
ClientLeft = 45
ClientTop = 330
ClientWidth = 8775
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5835
ScaleWidth = 8775
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Appearance = 0 'Flat
ForeColor = &H80000008&
Height = 5805
Left = 30
TabIndex = 15
Top = 0
Width = 2460
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 5580
Left = 60
TabIndex = 16
Top = 150
Width = 2340
_ExtentX = 4128
_ExtentY = 9843
_Version = 393216
FixedCols = 0
Appearance = 0
End
End
Begin VB.Frame Frame2
Appearance = 0 'Flat
ForeColor = &H80000008&
Height = 4845
Left = 2505
TabIndex = 0
Top = 0
Width = 6240
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 6
Top = 300
Width = 4440
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 5
Top = 952
Width = 4440
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 4
Top = 1604
Width = 4440
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 3
Top = 2256
Width = 4440
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 1560
TabIndex = 2
Top = 4200
Width = 4440
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
ItemData = "frmUser_up.frx":0000
Left = 1560
List = "frmUser_up.frx":000A
TabIndex = 1
Text = "正常使用"
Top = 3560
Width = 4440
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1560
TabIndex = 7
Top = 2925
Width = 4440
_ExtentX = 7832
_ExtentY = 661
_Version = 393216
Enabled = 0 'False
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 64094208
CurrentDate = 38776
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "登陆号码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 14
Top = 420
Width = 1485
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "姓 名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 13
Top = 1070
Width = 1485
End
Begin VB.Label Label5
Alignment = 1 'Right Justify
Caption = "注册日期:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 12
Top = 3020
Width = 1485
End
Begin VB.Label Label7
Alignment = 1 'Right Justify
Caption = "确认密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 11
Top = 2370
Width = 1485
End
Begin VB.Label Label8
Alignment = 1 'Right Justify
Caption = "密 码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 10
Top = 1720
Width = 1485
End
Begin VB.Label Label9
Alignment = 1 'Right Justify
Caption = "状 态:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 9
Top = 3670
Width = 1485
End
Begin VB.Label Label10
Alignment = 1 'Right Justify
Caption = "备 注:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 90
TabIndex = 8
Top = 4320
Width = 1485
End
End
Begin VB.Frame Frame3
Appearance = 0 'Flat
ForeColor = &H80000008&
Height = 1020
Left = 2505
TabIndex = 17
Top = 4785
Width = 6240
Begin VB.CommandButton Command1
Caption = "停 用(&S)"
Height = 420
Left = 3690
TabIndex = 20
Top = 330
Width = 1125
End
Begin VB.CommandButton Command3
Caption = "退 出(&E)"
Height = 420
Left = 4815
TabIndex = 19
Top = 330
Width = 1125
End
Begin VB.CommandButton Command4
Caption = "刷 新(&F)"
Height = 420
Left = 2565
TabIndex = 18
Top = 330
Width = 1125
End
End
End
Attribute VB_Name = "frmUser_up"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strHead As String
Dim strWid As String
Private Sub Command1_Click()
Dim strYYY As String
Dim rs As New ADODB.Recordset
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "数据错误!", vbInformation, "系统提示"
Exit Sub
End If
If Text3.Text <> Text4.Text Then
MsgBox "密码数据错误!", vbInformation, "系统提示"
Exit Sub
End If
If rs.State = 1 Then rs.Close
strYYY = "select * from T_用户表 where 登陆号码='" & Text1.Text & "'"
rs.Open strYYY, gCnn, adOpenStatic, adLockReadOnly
If rs.RecordCount > 0 Then
' strYYY = "update T_用户表 set 姓名='" & Text2.Text & "',密码='" & Text3.Text & "',状态='" & Combo1.Text & "',备注='" & Text5.Text & "',权限='' where 登陆号码='" & Text1.Text & "'"
strYYY = "update T_用户表 set 状态='" & Combo1.Text & "' where 登陆号码='" & Text1.Text & "'"
Else
' strYYY = "insert into T_用户表(登陆号码,姓名,密码,状态,加入日期,备注,权限) values('" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & Format(DTPicker1, "yyyy-mm-dd") & "','" & Text5 & "','')"
End If
gCnn.Execute strYYY
If rs.State = 1 Then rs.Close
MsgBox "保存成功!", vbInformation, "系统提示"
Call Form_Load
' gtxtclear
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Call Form_Load
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Form_Load()
' T_用户表 id,登陆号码,姓名,密码,状态,加入日期,备注,最后登陆日期
Dim rs As New ADODB.Recordset
If Me.WindowState = 0 Then Me.Move 0, 0
Call ShowHead
If rs.State = 1 Then rs.Close
MSFlexGrid1.Rows = 1
gSQL = "select 登陆号码,姓名,密码,状态,加入日期,备注 from T_用户表"
rs.Open gSQL, gCnn, adOpenStatic, adLockReadOnly
If rs.RecordCount >= 1 Then
rs.MoveFirst
Do While Not rs.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.Row = MSFlexGrid1.Rows - 1
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0) = rs.Fields(0).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) = rs.Fields(1).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2) = rs.Fields(2).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3) = rs.Fields(3).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 4) = rs.Fields(4).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 5) = rs.Fields(5).Value
rs.MoveNext
Loop
End If
If rs.State = 1 Then rs.Close
gtxtclear
End Sub
Private Sub ShowHead()
'MSFlexGrid1设置
strHead = "登陆号码,姓名,密码,状态,加入日期,备注"
strWid = "800,1200,0,0,0,0"
FillGridHead MSFlexGrid1, strHead, strWid
End Sub
Private Sub MSFlexGrid1_Click()
If MSFlexGrid1.Rows = 1 Then Exit Sub
If MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) = "" Then Exit Sub
Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)
Text1.Enabled = False
Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1)
Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2)
Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2)
Text5.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 5)
Combo1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3)
DTPicker1 = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 4)
End Sub
Public Sub gtxtclear()
' Text1.Enabled = True
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
DTPicker1 = Date
Combo1 = "正常使用"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -