📄 frmchangeuserpassword.frm
字号:
VERSION 5.00
Begin VB.Form frmChangeBuyerpassword
Caption = "买方密码管理"
ClientHeight = 3645
ClientLeft = 60
ClientTop = 450
ClientWidth = 6420
LinkTopic = "Form1"
ScaleHeight = 3645
ScaleWidth = 6420
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton CmdDeleteUser
Caption = "注销用户名"
Height = 375
Left = 1920
TabIndex = 9
Top = 2880
Width = 1215
End
Begin VB.CommandButton CmdAdduser
Caption = "增加新用户"
Height = 375
Left = 360
TabIndex = 8
Top = 2880
Width = 1215
End
Begin VB.CommandButton CmdQuery
Caption = "查询"
Height = 375
Left = 4560
TabIndex = 7
Top = 720
Width = 1215
End
Begin VB.CommandButton Cmdpasswordchange
Caption = "修改"
Height = 375
Left = 3480
TabIndex = 6
Top = 2880
Width = 1215
End
Begin VB.CommandButton Cmdcancel
Caption = "取消"
Height = 375
Left = 4920
TabIndex = 5
Top = 2880
Width = 1215
End
Begin VB.Frame Frame1
Caption = "密码管理"
Height = 1935
Left = 240
TabIndex = 0
Top = 360
Width = 6015
Begin VB.TextBox Txtusername
Height = 375
Left = 1800
TabIndex = 2
Top = 240
Width = 2055
End
Begin VB.TextBox Txtuserpassword
Height = 375
Left = 1800
TabIndex = 1
Top = 1080
Width = 2055
End
Begin VB.Label Label1
Caption = "请输入用户名"
Height = 375
Index = 0
Left = 240
TabIndex = 4
Top = 240
Width = 1455
End
Begin VB.Label Label1
Caption = "用户密码"
Height = 375
Index = 1
Left = 240
TabIndex = 3
Top = 1080
Width = 975
End
End
End
Attribute VB_Name = "frmChangeBuyerpassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdAdduser_Click()
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyregister where username = '" & Txtusername & "'"
RS.Open StrSQL, ConnStr, 1, 1
If RS.EOF Then
RS.Close
StrSQL = "select * from buyregister"
RS.Open StrSQL, ConnStr, 1, 3
RS.AddNew
RS("username") = Txtusername
RS("password") = Txtuserpassword
MsgBox "新用户已添加!", vbOKOnly Or vbInformation
Else
Txtusername = ""
Txtuserpassword = ""
MsgBox "此用户已存在!", vbCritical
End If
RS.Update
RS.Close
Set RS = Nothing
End Sub
Private Sub CmdCancel_Click()
Me.Hide
End Sub
Private Sub CmdDeleteUser_Click()
If MsgBox("是否删除此项?", vbYesNo Or vbQuestion) = vbYes Then
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyregister where username = '" & Txtusername & "'"
RS.Open StrSQL, ConnStr, 1, 3
If Not RS.EOF Then
RS.Delete
RS.Update
Txtusername = ""
Txtuserpassword = ""
Else
MsgBox "此项目已不存在!", vbCritical
End If
RS.Close
Set RS = Nothing
End If
End Sub
Private Sub Cmdpasswordchange_Click()
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyregister where username = '" & Txtusername & "'"
RS.Open StrSQL, ConnStr, 1, 3
If Not RS.EOF Then
RS("username") = Txtusername
RS("password") = Txtuserpassword
MsgBox "修改成功!", vbOKOnly Or vbInformation
End If
RS.Update
RS.Close
Set RS = Nothing
End Sub
Private Sub CmdQuery_Click()
Dim RS
Set RS = CreateObject("ADODB.RecordSet")
StrSQL = "select * from buyregister where username = '" & Txtusername & "'"
RS.Open StrSQL, ConnStr, 1, 3
If RS.EOF Then
MsgBox "查无此人!", vbOKOnly Or vbInformation
Else
Txtuserpassword = RS("password")
End If
RS.Close
Set RS = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -