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

📄 tjyh.frm

📁 学生管理系统 很不错的一个课程设计 适合大学生毕业设计用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form 添加用户 
   Caption         =   "系统管理-添加用户"
   ClientHeight    =   3555
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5715
   LinkTopic       =   "Form2"
   ScaleHeight     =   3555
   ScaleWidth      =   5715
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Caption         =   "增加用户"
      Height          =   3495
      Left            =   90
      TabIndex        =   0
      Top             =   0
      Width           =   5535
      Begin VB.CheckBox Check1 
         Caption         =   "系统管理员"
         Height          =   495
         Left            =   240
         TabIndex        =   9
         Top             =   1320
         Width           =   2295
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取消"
         Height          =   350
         Left            =   3120
         TabIndex        =   8
         Top             =   2880
         Width           =   855
      End
      Begin VB.CommandButton Command1 
         Caption         =   "添加"
         Height          =   350
         Left            =   1560
         TabIndex        =   7
         Top             =   2880
         Width           =   855
      End
      Begin VB.TextBox Text3 
         Height          =   270
         Left            =   3600
         TabIndex        =   6
         Top             =   1440
         Width           =   1695
      End
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   3600
         TabIndex        =   5
         Top             =   720
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   1080
         TabIndex        =   4
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "确认密码:"
         Height          =   255
         Left            =   2640
         TabIndex        =   3
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "密码:"
         Height          =   255
         Left            =   3000
         TabIndex        =   2
         Top             =   720
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "用户名:"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   720
         Width           =   735
      End
   End
End
Attribute VB_Name = "添加用户"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Trim(Text1.Text) = "" Then
 MsgBox "用户名不能为空!", vbExclamation + vbOKOnly, "警告"
 Text1.SetFocus
 Exit Sub
End If
Dim mrc As ADODB.Recordset
txtsql = "select * from 用户 where 用户名='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = False Then
  MsgBox " 已存在该用户!", vbExclamation + vbOKOnly, "警告"
  Text1.SetFocus
  Text1.SelStart = 0
  Text1.SelLength = Len(Text1.Text)
  Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""
   Check1.Value = 0
  Exit Sub
End If
If Trim(Text2.Text) = "" Then
 MsgBox "密码不能为空!", vbExclamation + vbOKOnly, "警告"
 Text2.SetFocus
 Exit Sub
End If
If Trim(Text3.Text) = "" Then
 MsgBox "确认密码不能为空!", vbExclamation + vbOKOnly, "警告"
 Text3.SetFocus
 Exit Sub
End If
If Trim(Text2.Text) <> Trim(Text3.Text) Then
 MsgBox "确认密码不正确!", vbExclamation + vbOKOnly, "警告"
 Text3.SetFocus
 Exit Sub
End If
Dim qx As String
If Check1.Value = 1 Then
  qx = "1"
Else
  qx = "0"
End If
txtsql = "select * from 用户"
Set mrc = ExecuteSQL(txtsql)
mrc.AddNew
  mrc.Fields(0) = Trim(Text1.Text)
  mrc.Fields(1) = Trim(Text2.Text)
  mrc.Fields(2) = qx
   mrc.Update
   MsgBox " 用户添加成功!", vbExclamation + vbOKOnly, "警告"
   Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""
   Check1.Value = 0
End Sub

Private Sub Command2_Click()
Unload Me
End Sub







⌨️ 快捷键说明

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