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

📄 frmsystemnewuser.frm

📁 教务管理系统,用VB 完成,以SQL SERVER 2000作为后台数据库
💻 FRM
字号:
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#2.0#0"; "THREED20.OCX"
Begin VB.Form frmSystemNewUser 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "新用户注册"
   ClientHeight    =   2670
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5205
   Icon            =   "frmSystemNewUser.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2670
   ScaleWidth      =   5205
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdExit 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3840
      TabIndex        =   3
      Top             =   1155
      Width           =   1215
   End
   Begin VB.CommandButton cmdDenJ 
      BackColor       =   &H00C0C0C0&
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3840
      MaskColor       =   &H00FFFFFF&
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   600
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin Threed.SSFrame SSFrame1 
      Height          =   2235
      Left            =   240
      TabIndex        =   4
      Top             =   180
      Width           =   3495
      _ExtentX        =   6165
      _ExtentY        =   3942
      _Version        =   131073
      Font3D          =   1
      ForeColor       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "新用户登记"
      PictureAlignment=   1
      ShadowStyle     =   1
      Begin VB.TextBox txtPwd 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   1770
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   1290
         Width           =   1515
      End
      Begin VB.TextBox txtUser 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1770
         TabIndex        =   0
         Top             =   660
         Width           =   1515
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         Caption         =   "用户密码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   375
         Left            =   210
         TabIndex        =   6
         Top             =   1350
         Width           =   1335
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         Caption         =   "用户名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   375
         Left            =   210
         TabIndex        =   5
         Top             =   660
         Width           =   1335
      End
   End
End
Attribute VB_Name = "frmSystemNewUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Recuser As Recordset

Private Sub cmdDenJ_Click()
'用户名不能重复
Recuser.FindFirst "user='" + Trim(txtUser) + "'"
If Not Recuser.NoMatch Then
    MsgBox "您输入的用户名已被使用", vbExclamation + vbOKOnly, "信息"
    txtUser = ""
    txtUser.SetFocus
    Exit Sub
End If
'密码不能为空
If Len(txtPwd) = 0 Then
    MsgBox "密码不能为空", vbExclamation + vbOKOnly, "信息"
    txtPwd = ""
    txtPwd.SetFocus
    Exit Sub
End If
'添加新用户
Recuser.AddNew
Recuser.Fields("user") = txtUser
Recuser.Fields("pwd") = txtPwd
If txtUser.Text = "" Or txtPwd.Text = "" Then
txtPwd.SetFocus
End If
Recuser.Update
MsgBox "祝贺您!您已登记成功", vbExclamation + vbOKOnly, "信息"
txtPwd = ""
txtUser = ""
Unload Me
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub


Private Sub Form_Load()
Set Recuser = Dbstudent.OpenRecordset("select * from user", dbOpenDynaset)
End Sub

Private Sub txtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdDenJ_Click
End If
End Sub

⌨️ 快捷键说明

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