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

📄 frmnew_user.frm

📁 用VB开发的一个学生管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmNew_user 
   Caption         =   "注册用户"
   ClientHeight    =   3120
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3120
   ScaleWidth      =   4680
   StartUpPosition =   2  '屏幕中心
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "F:\student_management\student_MG.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   480
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "Users"
      Top             =   2040
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.CommandButton cmd_cancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   2400
      TabIndex        =   7
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton cmd_OK 
      Caption         =   "确定"
      Height          =   495
      Left            =   840
      TabIndex        =   6
      Top             =   2400
      Width           =   1095
   End
   Begin VB.TextBox txtPwd2 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   1920
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   1560
      Width           =   2055
   End
   Begin VB.TextBox txtPwd1 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   1920
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   840
      Width           =   2055
   End
   Begin VB.TextBox txtUser 
      Height          =   495
      Left            =   1920
      TabIndex        =   1
      Top             =   240
      Width           =   2055
   End
   Begin VB.Label Label3 
      Caption         =   "请确认密码:"
      Height          =   375
      Left            =   480
      TabIndex        =   4
      Top             =   1560
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "请输入密码:"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   960
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "用户名:"
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   360
      Width           =   1095
   End
End
Attribute VB_Name = "FrmNew_user"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_cancel_Click()
Unload Me
End Sub

Private Sub cmd_OK_Click()
If txtUser = "" Then
MsgBox "请输入用户名", vbExclamation, "警告"
txtUser.SetFocus
Else
If txtPwd1 = "" Then
MsgBox "请输入密码", vbExclamation, "警告"
txtPwd1.SetFocus
Else
If txtPwd2 = "" Then
MsgBox "请确认密码", vbExclamation, "警告"
txtPwd2.SetFocus
Else
If Trim(txtPwd1.Text) = Trim(txtPwd2.Text) Then
 Data1.Recordset.AddNew
 Data1.Recordset("UserName") = Trim(txtUser.Text)
Data1.Recordset("UserPwd") = Trim(txtPwd1.Text)
Data1.Recordset.Update
MsgBox "注册成功", 48, "注册"
Unload Me
FrmMain.Show
Else
   MsgBox "确认密码有误", 0 + 48, "警告!"
End If
End If
End If
End If

End Sub


Private Sub Form_Load()

Dim dbname As String
Dim sql As String
dbname = App.Path
If Right$(dbname, 1) <> "\" Then dbname = dbname & "\"
dbname = dbname & "student_MG.mdb"
Data1.DatabaseName = dbname
sql = "select * from " & "Users"
Data1.RecordSource = sql
End Sub

⌨️ 快捷键说明

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