⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w_changpassword.frm

📁 一个企业生产管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form w_changepassword 
   BackColor       =   &H80000004&
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cb_2 
      Caption         =   "取消"
      Height          =   375
      Left            =   3360
      TabIndex        =   9
      Top             =   1680
      Width           =   855
   End
   Begin VB.CommandButton cb_1 
      Caption         =   "确定"
      Height          =   375
      Left            =   3360
      TabIndex        =   8
      Top             =   720
      Width           =   855
   End
   Begin VB.TextBox confirm_password 
      Height          =   270
      Left            =   1920
      TabIndex        =   7
      Top             =   1800
      Width           =   975
   End
   Begin VB.TextBox new_password 
      Height          =   270
      Left            =   1920
      TabIndex        =   6
      Top             =   1320
      Width           =   975
   End
   Begin VB.TextBox old_password 
      Height          =   270
      Left            =   1920
      TabIndex        =   5
      Top             =   840
      Width           =   975
   End
   Begin VB.TextBox user_id 
      Height          =   270
      Left            =   1920
      TabIndex        =   4
      Top             =   360
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "确认密码"
      Height          =   255
      Index           =   3
      Left            =   720
      TabIndex        =   3
      Top             =   1800
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "新 密 码"
      Height          =   255
      Index           =   2
      Left            =   720
      TabIndex        =   2
      Top             =   1320
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "旧 密 码"
      Height          =   255
      Index           =   1
      Left            =   720
      TabIndex        =   1
      Top             =   840
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "用户编号"
      Height          =   255
      Index           =   0
      Left            =   720
      TabIndex        =   0
      Top             =   360
      Width           =   855
   End
End
Attribute VB_Name = "w_changepassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cb_1_Click()
Dim ccn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim asql As String
Set rs = New ADODB.Recordset
Set ccn = New ADODB.Connection
    With ccn
        .ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=warehouse;"
        .Open
    End With
    asql = "select * From operator where employee_id = '" & user_id.Text & "' and password = '" & old_password.Text & "'"
If gs_rights <> "管理员" And gs_rights <> "系统" Then
 
    rs.Open asql, ccn, adOpenStatic, adLockBatchOptimistic
    If rs.RecordCount < 1 Then
     If MsgBox("修改口令", vbOKCancel, "在修改口令时出错,请检查用户编号和老口令!") = vbCancel Then Exit Sub
    End If
End If

If new_password.Text <> confirm_password.Text Then
   If MsgBox("修改口令", vbOKOnly, "在修改口令时出错,二次输入的口令不一致!") = vbOK Then Exit Sub
    Exit Sub
Else
asql = "Update operator Set password = '" & CStr(new_password.Text) & " ' Where employee_id = '" & user_id.Text & "'"
    ccn.Execute asql
'    IF SQLCA.SQLCode = 0 THEN    MessageBox("修改口令", "已成功修改口令!")
End If

End Sub

Private Sub Form_Load()
'dw_1.settransobject (sqlca)
'dw_1.InsertRow (0)


If gs_rights = "管理员" Or gs_rights = "系统" Then
    old_password.Enabled = False
'    new_password.Locked = True
    old_password.BackColor = &H808
Else
    user_id.Text = Trim(gs_userid)
    user_id.Enabled = False
'    dw_1.Modify ("user_id.background.color = '78682240'")
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -