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

📄 xgpaword.frm

📁 一个关于企业工资管理的数据库应用的例子。
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form xgpaword 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "超级用户密码修改"
   ClientHeight    =   4500
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5355
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4500
   ScaleWidth      =   5355
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   495
      Left            =   1080
      Top             =   4680
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      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;Data Source=qygzgl"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin TabDlg.SSTab SSTab1 
      Height          =   3975
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   7011
      _Version        =   393216
      Tabs            =   2
      TabHeight       =   520
      TabCaption(0)   =   "修改密码"
      TabPicture(0)   =   "xgpaword.frx":0000
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "Picture1"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "Command1"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "Command2"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).ControlCount=   3
      TabCaption(1)   =   "删除用户"
      TabPicture(1)   =   "xgpaword.frx":001C
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "Picture2"
      Tab(1).Control(1)=   "Command4"
      Tab(1).Control(2)=   "Command3"
      Tab(1).ControlCount=   3
      Begin VB.PictureBox Picture2 
         Height          =   2055
         Left            =   -74520
         ScaleHeight     =   1995
         ScaleWidth      =   2955
         TabIndex        =   12
         Top             =   600
         Width           =   3015
         Begin VB.TextBox Text5 
            Height          =   375
            IMEMode         =   3  'DISABLE
            Left            =   1200
            PasswordChar    =   "*"
            TabIndex        =   16
            Top             =   960
            Width           =   1455
         End
         Begin VB.TextBox Text4 
            Height          =   375
            Left            =   1200
            TabIndex        =   15
            Top             =   240
            Width           =   1455
         End
         Begin VB.Label Label5 
            Caption         =   "用户密码:"
            Height          =   495
            Left            =   120
            TabIndex        =   14
            Top             =   1080
            Width           =   1095
         End
         Begin VB.Label Label4 
            Caption         =   "用户名称:"
            Height          =   375
            Left            =   120
            TabIndex        =   13
            Top             =   240
            Width           =   1095
         End
      End
      Begin VB.CommandButton Command4 
         Caption         =   "取消"
         Height          =   375
         Left            =   -72840
         TabIndex        =   11
         Top             =   3120
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         Caption         =   "删除"
         Height          =   375
         Left            =   -74520
         TabIndex        =   10
         Top             =   3120
         Width           =   1215
      End
      Begin VB.CommandButton Command2 
         Caption         =   "返回"
         Height          =   375
         Left            =   2280
         TabIndex        =   9
         Top             =   3120
         Width           =   1335
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   720
         TabIndex        =   8
         Top             =   3120
         Width           =   1215
      End
      Begin VB.PictureBox Picture1 
         Height          =   2295
         Left            =   480
         ScaleHeight     =   2235
         ScaleWidth      =   3315
         TabIndex        =   1
         Top             =   600
         Width           =   3375
         Begin VB.TextBox Text3 
            Height          =   375
            IMEMode         =   3  'DISABLE
            Left            =   1440
            PasswordChar    =   "*"
            TabIndex        =   7
            Top             =   1440
            Width           =   1455
         End
         Begin VB.TextBox Text2 
            Height          =   375
            IMEMode         =   3  'DISABLE
            Left            =   1440
            PasswordChar    =   "*"
            TabIndex        =   6
            Top             =   720
            Width           =   1455
         End
         Begin VB.TextBox Text1 
            Height          =   375
            Left            =   1440
            TabIndex        =   5
            Top             =   120
            Width           =   1455
         End
         Begin VB.Label Label3 
            Caption         =   "用户新密码:"
            Height          =   495
            Left            =   120
            TabIndex        =   4
            Top             =   1560
            Width           =   1215
         End
         Begin VB.Label Label2 
            Caption         =   "用户原密码:"
            Height          =   495
            Left            =   120
            TabIndex        =   3
            Top             =   840
            Width           =   1095
         End
         Begin VB.Label Label1 
            Caption         =   "用户名:"
            Height          =   375
            Left            =   120
            TabIndex        =   2
            Top             =   120
            Width           =   1095
         End
      End
   End
End
Attribute VB_Name = "xgpaword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
Dim StrSQL As String
StrSQL = "select adminid,adminpass from admin where adminid= '" & Trim(Text1.Text) & "'and adminpass ='" & Trim(Text2.Text) & "'"
If Trim(Text1.Text) <> Empty And Trim(Text2.Text) <> Empty And Trim(Text3.Text) <> Empty Then
        If rs.State = adStateClosed Then
             rs.Open StrSQL, conn, adOpenKeyset, adLockPessimistic, adCmdText   '//打开记录集
        End If
            If rs.RecordCount <> 0 Then
                rs.Fields(1).value = Trim(Text3.Text)
                rs.Update
                MsgBox "密码修改成功", , "密码修改"
                Unload Me
            Else
                MsgBox "没有该用户", vbExclamation, "验证失败"
                rs.Close
            End If
Else
    MsgBox "请输入要修改的用户名及密码 ", vbInformation, "错误提示"
    rs.Close
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub command3_click()
Dim conn1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
conn1.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
Dim StrSQL1 As String
StrSQL1 = "select adminid,adminpass from admin where adminid= '" & Trim(Text4.Text) & "'and adminpass ='" & Trim(Text5.Text) & "'"
If rs1.State = adStateClosed Then
    rs1.Open StrSQL1, conn1, adOpenKeyset, adLockPessimistic, adCmdText
End If
If Trim(Text4.Text) <> Empty And Trim(Text5.Text) <> Empty Then
    If rs1.RecordCount <> 0 Then
        If MsgBox("确定删除该用户?", vbInformation + vbYesNo, "删除用户") = vbYes Then
            rs1.Delete        '//删除记录
            MsgBox "用户已删除", , "删除成功"
            Unload Me
        End If
    Else
        MsgBox "没有该用户", , "删除失败"
       rs1.Close
    End If
Else
MsgBox "请输入要删除的用户名及密码", vbInformation + vbOKOnly, "验证错误"
rs1.Close
End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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