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

📄 frmxgmm.frm

📁 以前写的一个销售的管理系统,是牙刷销存管理系统,有销售,进货等功能,刚学VB时写的
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmxgmm 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "兴盛牙刷销存管理系统--修改密码"
   ClientHeight    =   3390
   ClientLeft      =   3690
   ClientTop       =   2685
   ClientWidth     =   4680
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3390
   ScaleWidth      =   4680
   Begin VB.CommandButton Command2 
      Caption         =   "返  回"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2760
      TabIndex        =   4
      Top             =   2760
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确  认"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   720
      TabIndex        =   3
      Top             =   2760
      Width           =   1095
   End
   Begin VB.TextBox txtnew 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   2160
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   2040
      Width           =   1695
   End
   Begin VB.TextBox txtuser 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2160
      TabIndex        =   0
      Top             =   360
      Width           =   1695
   End
   Begin VB.TextBox txtpwd 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   2160
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1200
      Width           =   1695
   End
   Begin VB.Label Label3 
      Caption         =   "新 密 码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   7
      Top             =   2040
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "旧 密 码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   6
      Top             =   1320
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "用 户 名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   720
      TabIndex        =   5
      Top             =   480
      Width           =   1335
   End
End
Attribute VB_Name = "frmxgmm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
  DefaultType = dbUseODBC
  Dim db As Database
  Dim rs As Recordset
  Dim cx As Boolean
  cx = False
  Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
  Set rs = db.OpenRecordset("yhk", dbOpenDynaset, dbwrite, dbOptimistic)
  Do While rs.EOF <> True
     If rs.Fields("用户名") = LTrim(txtuser.Text) Then
        cx = True
        Exit Do
     End If
     If rs.EOF = True Then
        Exit Do
     End If
     rs.MoveNext
  Loop
  If txtuser.Text = "" Or txtpwd.Text = "" Or txtnew.Text = "" Then
     MsgBox "输入不能为空,请重新填写!"
     Command2.SetFocus
  Else
     If MsgBox("请确认填写无误,否则修改!", vbOKCancel, "提示") = vbOK Then
        If cx = False Then
           MsgBox "无此用户,请先分配此用户!", vbCritical, "提示"
           txtuser.SetFocus
        Else
           If txtpwd.Text = rs.Fields("密码") Then
              With rs
                  .Edit
                  .Fields("密码") = LTrim(txtnew.Text)
                  .Update
                  .Close
              End With
              MsgBox "密码修改成功!", vbInformation, "提示"
              txtuser.Text = ""
              txtpwd.Text = ""
              txtnew.Text = ""
           Else
              MsgBox "原密码不对,请重新输入!", vbCritical, "错误"
              txtpwd.Text = ""
              txtnew.Text = ""
              txtpwd.SetFocus
           End If
         End If
     Else
         Command2.SetFocus
     End If
  End If
  db.Close
End Sub

Private Sub Command2_Click()
  Unload Me
  frmmenu.Show
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
  Dim nexttabindex As Integer, i As Integer
       If KeyAscii = 13 Then
          If Screen.ActiveControl.TabIndex = Count - 1 Then
             nexttabindex = 0
          Else
             nexttabindex = Screen.ActiveControl.TabIndex + 1
          End If
          For i = 0 To Count - 1
              If Me.Controls(i).TabIndex = nexttabindex Then
                 Me.Controls(i).SetFocus
                 Exit For
              End If
          Next i
          KeyAscii = 0
        End If
End Sub

Private Sub Form_Load()
  If frmmenu.fpxyh.Enabled = True Then
     txtuser.Text = frmlogin.Combo1.Text
  Else
     txtuser.Text = frmlogin.Combo1.Text
     txtuser.Locked = True
  End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Unload Me
End Sub

⌨️ 快捷键说明

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