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

📄 addbj.frm

📁 学生信息管理系统2.0,增加了数据库的恢复和备份
💻 FRM
字号:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SmartXPButton.ocx"
Begin VB.Form addbj 
   BackColor       =   &H00E7DFE7&
   Caption         =   "添加班级"
   ClientHeight    =   4005
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5535
   Icon            =   "addbj.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   4005
   ScaleWidth      =   5535
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   2760
      TabIndex        =   0
      Top             =   960
      Width           =   1575
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   2760
      TabIndex        =   1
      Top             =   1680
      Width           =   1575
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   2760
      TabIndex        =   2
      Top             =   2400
      Width           =   1575
   End
   Begin SmartXPButton.XpButton cmdcancel 
      Height          =   495
      Left            =   3000
      TabIndex        =   4
      Top             =   3120
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   873
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "取消(&C)"
      PictureSmoothBackColor=   15460844
      ButtonPicture   =   "addbj.frx":0A02
   End
   Begin SmartXPButton.XpButton cmdok 
      Height          =   495
      Left            =   720
      TabIndex        =   3
      Top             =   3120
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   873
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "添加(&O)"
      PictureSmoothBackColor=   15460844
      ButtonPicture   =   "addbj.frx":1414
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "班级设置"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000002&
      Height          =   495
      Left            =   1800
      TabIndex        =   8
      Top             =   240
      Width           =   1935
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "班级编号:"
      Height          =   495
      Left            =   1800
      TabIndex        =   7
      Top             =   1080
      Width           =   855
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "班级名称:"
      Height          =   255
      Left            =   1845
      TabIndex        =   6
      Top             =   1800
      Width           =   735
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "班长学号:"
      Height          =   375
      Left            =   1845
      TabIndex        =   5
      Top             =   2520
      Width           =   975
   End
   Begin VB.Image Image1 
      Height          =   1740
      Left            =   240
      Picture         =   "addbj.frx":1E26
      Top             =   960
      Width           =   1380
   End
End
Attribute VB_Name = "addbj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim MyConn As New ADODB.Connection
Dim str As String
Dim MyStr As String
Dim MyRs As New ADODB.Recordset
Private Sub cmdcancel_Click()
MyRs.Close
Unload Me
End Sub

Private Sub cmdok_Click()
If Len(Trim(Text1.Text)) <> 0 And Len(Trim(Text2.Text)) <> 0 And Len(Trim(Text3.Text)) <> 0 Then
 With MyRs
    .AddNew
    .Fields("ID") = Trim(Text1.Text)
    .Fields("NAME") = Trim(Text2.Text)
    .Fields("MONITOR") = Trim(Text3.Text)
    .Update
  End With
  MsgBox "班级信息已添加成功!", vbOKOnly + vbInformation, "提示信息"
  Text1.Text = ""
  Text2.Text = ""
  Text3.Text = ""
  Text1.SetFocus
Else
   MsgBox "用户名和密码不能为空!", vbOKOnly + vbExclamation, "错误提示"
End If
End Sub

Private Sub Form_Load()
MyStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=stuinfo.mdb"
MyRs.CursorLocation = adUseClient
'***** 使用Recordset对象的Open方法创建记录集 *****
MyRs.Open "class", MyStr, adOpenStatic, adLockOptimistic, adCmdTable
End Sub

⌨️ 快捷键说明

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