📄 frm_yhzc.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_YHZC
Caption = "用户管理"
ClientHeight = 2355
ClientLeft = 3855
ClientTop = 3090
ClientWidth = 3945
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2355
ScaleWidth = 3945
Begin VB.TextBox Text10
Height = 375
Left = 1200
TabIndex = 14
Text = "Text10"
Top = 2760
Visible = 0 'False
Width = 855
End
Begin VB.TextBox Text9
DataField = "用户名"
DataSource = "Adodc1"
Height = 375
Index = 0
Left = 2280
TabIndex = 13
Text = "Text9"
Top = 2760
Visible = 0 'False
Width = 615
End
Begin VB.TextBox Text8
DataField = "口令"
DataSource = "Adodc1"
Height = 375
Index = 0
Left = 3120
TabIndex = 11
Text = "Text8"
Top = 2760
Visible = 0 'False
Width = 735
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 240
Top = 3240
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MRSOFT"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MRSOFT"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Table_YHDL"
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.TextBox Text4
Height = 270
Left = 600
TabIndex = 2
Text = "111"
Top = 1920
Visible = 0 'False
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3000
TabIndex = 1
Top = 1920
Width = 855
End
Begin VB.Frame Frame3
Caption = "删除用户"
Height = 1095
Left = 120
TabIndex = 22
Top = 480
Width = 3735
Begin VB.CommandButton Command5
Caption = "<<"
Height = 320
Left = 3120
TabIndex = 25
Top = 360
Width = 370
End
Begin VB.TextBox Text9
DataField = "用户名"
DataSource = "Adodc1"
Height = 300
Index = 1
Left = 1680
TabIndex = 23
Top = 360
Width = 1455
End
Begin VB.Label Label1
Caption = "用户名"
Height = 255
Index = 1
Left = 480
TabIndex = 24
Top = 480
Width = 855
End
End
Begin VB.CommandButton Command4
Caption = "删除"
Height = 375
Left = 2040
TabIndex = 12
Top = 1920
Width = 855
End
Begin VB.CommandButton Command3
Caption = "修改"
Height = 375
Left = 2040
TabIndex = 3
Top = 1920
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 2040
TabIndex = 0
Top = 1920
Width = 855
End
Begin VB.Frame Frame1
Caption = "新用户注册"
Height = 1695
Left = 120
TabIndex = 15
Top = 120
Width = 3735
Begin VB.TextBox Text3
Height = 300
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 21
Top = 1200
Width = 1815
End
Begin VB.TextBox Text2
Height = 300
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 20
Top = 720
Width = 1815
End
Begin VB.TextBox Text1
Height = 300
Left = 1680
TabIndex = 19
Top = 240
Width = 1815
End
Begin VB.Label Label3
Caption = "确认新密码"
Height = 255
Left = 360
TabIndex = 18
Top = 1320
Width = 1215
End
Begin VB.Label Label2
Caption = "新密码"
Height = 375
Index = 0
Left = 360
TabIndex = 17
Top = 840
Width = 1455
End
Begin VB.Label Label1
Caption = "新用户名"
Height = 255
Index = 0
Left = 360
TabIndex = 16
Top = 360
Width = 975
End
End
Begin VB.Frame Frame2
Caption = "密码修改"
Height = 1695
Left = 120
TabIndex = 4
Top = 120
Width = 3735
Begin VB.TextBox Text7
Height = 300
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 10
Top = 1200
Width = 1815
End
Begin VB.TextBox Text6
Height = 300
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 9
Top = 720
Width = 1815
End
Begin VB.TextBox Text5
Height = 300
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 8
Top = 240
Width = 1815
End
Begin VB.Label Label6
Caption = "请确认新密码"
Height = 255
Left = 240
TabIndex = 7
Top = 1320
Width = 1455
End
Begin VB.Label Label5
Caption = "请输入新密码"
Height = 255
Left = 240
TabIndex = 6
Top = 840
Width = 1215
End
Begin VB.Label Label4
Caption = "请输入旧密码"
Height = 255
Left = 240
TabIndex = 5
Top = 360
Width = 1215
End
End
End
Attribute VB_Name = "frm_YHZC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Public adoCon As New ADODB.Connection
'Public adoRs As New ADODB.Recordset
Private Sub Command1_Click()
' Set adoCon = New ADODB.Connection
' adoCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_MRSOFT;Data Source=MRVB"
On Error Resume Next
Call main
If Text2.Text = Text3.Text Then
Set adoRs = adoCon.Execute("insert into Table_YHDL values(" & Text4 & ",'" & Text1 & "','" & Text2 & "')")
MsgBox "新用户注册成功完成!!"
frm_YHZC.Hide
frm_RYXS.Adodc1.Refresh
Else
MsgBox "两次输入的密码不一致,请您确认后重新输入"
End If
adoCon.Close
End Sub
Private Sub Command2_Click()
frm_YHZC.Hide
End Sub
Private Sub Command3_Click()
' Set adoCon = New ADODB.Connection
' adoCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_MRSOFT;Data Source=MRVB"
Call main
Adodc1.RecordSource = "select * from Table_YHDL where 口令 ='" + Text5.Text + "'"
Adodc1.Refresh
If Text8(0).Text = "" Then
MsgBox "对不起,您没有设置此密码,请您确认后重新输入"
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text5.SetFocus
Else
If Text6.Text = "" Then
MsgBox "请输入新密码"
ElseIf Text7.Text = "" Then
MsgBox "请您确认新密码"
ElseIf Text6.Text = Text7.Text Then
Text10.Text = Text9(0).Text
Adodc1.Recordset.Delete
Set adoRs = adoCon.Execute("insert into Table_YHDL values(" & Text4 & ",'" & Text10 & "','" & Text6 & "')")
MsgBox "您的密码已经修改成功,请您记住新密码"
frm_YHZC.Hide
Else
MsgBox "两次输入的密码不一致,请您确认后重新输入"
Text6.Text = ""
Text7.Text = ""
Text6.SetFocus
End If
End If
adoCon.Close
End Sub
Private Sub Command4_Click()
Dim I
On Error Resume Next
I = MsgBox("确认要删除该用户吗?", 33, "通用固定资产及设备管理系统")
If I = vbOK Then
Adodc1.RecordSource = "select * from Table_YHDL where 用户名 ='" + Text9(1).Text + "'"
Adodc1.Refresh
Adodc1.Recordset.Delete
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveNext
Else
Adodc1.Recordset.MoveNext
End If
frm_YHZC.Hide
Else
End If
End Sub
Private Sub Command5_Click()
frm_RYXS.Show
frm_RYXS.Caption = "删除用户选择"
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
Else
End If
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
Call main
If KeyCode = 13 Then
Adodc1.RecordSource = "select * from Table_YHDL where 口令 ='" + Text5.Text + "'"
Adodc1.Refresh
If Text8(0).Text = "" Then
MsgBox "对不起,您没有设置此密码,请您确认后重新输入"
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text5.SetFocus
Else
If Text6.Text = "" Then
MsgBox "请输入新密码"
ElseIf Text7.Text = "" Then
MsgBox "请您确认新密码"
ElseIf Text6.Text = Text7.Text Then
Text10.Text = Text9(0).Text
Adodc1.Recordset.Delete
Set adoRs = adoCon.Execute("insert into Table_YHDL values(" & Text4 & ",'" & Text10 & "','" & Text6 & "')")
MsgBox "您的密码已经修改成功,请您记住新密码"
frm_YHZC.Hide
Else
MsgBox "两次输入的密码不一致,请您确认后重新输入"
Text6.Text = ""
Text7.Text = ""
Text6.SetFocus
End If
End If
Else
End If
adoCon.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -