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

📄 frmadd.frm

📁 此源码是针对配套的光学标记阅读机使用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmadd 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "添加用户"
   ClientHeight    =   3330
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5415
   Icon            =   "frmadd.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3330
   ScaleWidth      =   5415
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdcancel 
      Caption         =   "取消"
      Height          =   615
      Left            =   2880
      TabIndex        =   7
      Top             =   2520
      Width           =   1695
   End
   Begin VB.CommandButton cmdok 
      Caption         =   "确定"
      Height          =   615
      Left            =   480
      TabIndex        =   6
      Top             =   2520
      Width           =   1695
   End
   Begin VB.TextBox confirmpwd 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2520
      TabIndex        =   5
      Top             =   1800
      Width           =   2175
   End
   Begin VB.TextBox password 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2520
      TabIndex        =   4
      Top             =   960
      Width           =   2175
   End
   Begin VB.TextBox username 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2520
      TabIndex        =   3
      Top             =   240
      Width           =   2175
   End
   Begin VB.Label Label3 
      Caption         =   "确认密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   360
      TabIndex        =   2
      Top             =   1800
      Width           =   1695
   End
   Begin VB.Label Label2 
      Caption         =   "用户密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   360
      TabIndex        =   1
      Top             =   960
      Width           =   1575
   End
   Begin VB.Label Label1 
      Caption         =   "新用户名称"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   1455
   End
End
Attribute VB_Name = "frmadd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdOK_Click()
    Dim sql As String
    Dim rs As ADODB.Recordset
    If Trim(username.Text) = "" Then
          MsgBox "请输入用户名称", vbOKOnly + vbExclamation, "警告"
          Exit Sub
          username.SetFocus
    Else
        
        sql = "select * from admin where admin= '" & username & "'"
        Set rs = getRS(sql)
        If rs.EOF = False Then
            MsgBox "这个用户已经存在,请你重新输入用户名", vbOKOnly + vbExclamation, "警告"
            username.Text = ""
            password.Text = ""
            confirmpwd.Text = ""
            Exit Sub
        Else
            If Trim(password.Text) <> Trim(confirmpwd.Text) Then
            MsgBox "二次输入密码不一样,请你重新输入密码", vbOKOnly + vbExclamation, "警告"
            
            password.Text = ""
            confirmpwd.Text = ""
            password.SetFocus
        ElseIf Trim(password.Text) = "" Then
            MsgBox "密码不能为空", vbOKOnly + vbExclamation, "警告"
            password.Text = ""
            confirmpwd.Text = ""
            password.SetFocus
        Else
           sql = "insert into admin(admin,mima) values ('" & username & "','" & password & "')"
            Call TransactSQL(sql)
            MsgBox "添加成功", vbOKOnly + vbExclamation, "添加结果"
            username.Text = ""
            password.Text = ""
            confirmpwd.Text = ""
            username.SetFocus
            
            End If
        End If
    
    End If

End Sub

⌨️ 快捷键说明

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