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

📄 frmclassedit.frm

📁 随着学校的规模不断扩大
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmClassEdit 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "班级编辑"
   ClientHeight    =   2985
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4590
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   10.5
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2985
   ScaleWidth      =   4590
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "返回(&R)"
      Height          =   435
      Left            =   3450
      TabIndex        =   6
      Top             =   2400
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "保存(&S)"
      Height          =   435
      Left            =   2130
      TabIndex        =   5
      Top             =   2400
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Height          =   2385
      Left            =   60
      TabIndex        =   0
      Top             =   -60
      Width           =   4485
      Begin VB.TextBox Text2 
         Height          =   345
         Left            =   1140
         TabIndex        =   4
         Top             =   900
         Width           =   3225
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1140
         TabIndex        =   2
         Top             =   330
         Width           =   3225
      End
      Begin VB.Label Label2 
         Caption         =   "班级备注:"
         Height          =   195
         Left            =   90
         TabIndex        =   3
         Top             =   990
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "班级名称:"
         Height          =   210
         Left            =   120
         TabIndex        =   1
         Top             =   420
         Width           =   945
      End
   End
End
Attribute VB_Name = "frmClassEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''============================模块说明=================================
''名称:
''功能:
''作者:
''日期:
''备注:


''版本  修改日期                   修改人               原因


''====================================================================

Option Explicit

Private Sub Command1_Click()
Dim rst As Recordset
On Error GoTo Proc_Exit
    If Len(Text1) = 0 Then
        MsgBox "班级名称不为空!", vbInformation
        GoTo Proc_Exit
    End If
    
    Set rst = New Recordset
    rst.ActiveConnection = pCN
    rst.CursorLocation = adUseClient
    rst.LockType = adLockBatchOptimistic
    rst.CursorType = adOpenStatic
    rst.Source = "select * from 班级信息"
    rst.Open
    rst.AddNew
    
    rst![班级名称] = Text1
    rst![班级备注] = Text2
    rst.UpdateBatch
    Text1.Text = ""
    Text2.Text = ""
    Text1.SetFocus
Proc_Exit:

    Set rst = Nothing
    If Err.Number <> 0 Then
        If Err.Number = -2147467259 Then
            MsgBox "班级名称不能重复!", vbInformation
        Else
            MsgBox "发生意外错误,错误号:" & Err.Number & " 错误描述:" & Err.Description, vbInformation
        End If
        Err.Clear
    End If
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

⌨️ 快捷键说明

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