form3.frm

来自「本人课程设计做的一个简单的教务辅助管理系统,实现了数据库的一般操作,适合初学者学」· FRM 代码 · 共 173 行

FRM
173
字号
VERSION 5.00
Begin VB.Form frmmain 
   Caption         =   "Form3"
   ClientHeight    =   5640
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   7500
   LinkTopic       =   "Form3"
   Picture         =   "Form3.frx":0000
   ScaleHeight     =   5640
   ScaleWidth      =   7500
   StartUpPosition =   3  '窗口缺省
   Begin VB.Menu A 
      Caption         =   "系统设置"
      Begin VB.Menu A2 
         Caption         =   "添加用户"
         Shortcut        =   ^B
      End
      Begin VB.Menu in 
         Caption         =   "数据库备份"
         Shortcut        =   ^I
      End
      Begin VB.Menu out 
         Caption         =   "数据库恢复"
         Shortcut        =   ^O
      End
   End
   Begin VB.Menu B 
      Caption         =   "教师管理"
      Begin VB.Menu B1 
         Caption         =   "基本信息录入"
         Shortcut        =   ^C
      End
      Begin VB.Menu B2 
         Caption         =   "基本信息查询"
         Shortcut        =   ^D
      End
   End
   Begin VB.Menu C 
      Caption         =   "课程管理"
      Begin VB.Menu C1 
         Caption         =   "基本信息录入"
         Shortcut        =   ^E
      End
      Begin VB.Menu C2 
         Caption         =   "基本信息查询"
         Shortcut        =   ^F
      End
   End
   Begin VB.Menu D 
      Caption         =   "上课信息管理"
      Begin VB.Menu D1 
         Caption         =   "上课信息录入"
         Shortcut        =   ^G
      End
      Begin VB.Menu D2 
         Caption         =   "上课信息查询"
         Shortcut        =   ^H
      End
   End
   Begin VB.Menu F 
      Caption         =   "教室资源管理"
      Begin VB.Menu F1 
         Caption         =   "添加教室"
         Shortcut        =   ^Q
      End
      Begin VB.Menu F2 
         Caption         =   "查询教室"
         Shortcut        =   ^J
      End
   End
   Begin VB.Menu E 
      Caption         =   "退出"
   End
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False






Private Sub A2_Click()
添加用户.Show
End Sub

Private Sub B1_Click()
添加教师信息.Show
End Sub

Private Sub B2_Click()
教师信息查询.Show
End Sub

Private Sub C1_Click()
添加课程信息.Show
End Sub

Private Sub C2_Click()
课程信息查询.Show
End Sub

Private Sub D1_Click()
添加上课教师信息.Show

End Sub

Private Sub D2_Click()
教师上课信息查询.Show
End Sub

Private Sub D3_Click()
Form1.Show
End Sub

Private Sub E_Click()
If MsgBox("确定退出?", vbOKCancel, "提示") = vbOK Then

Unload Me
End If
End Sub

Private Sub F1_Click()
添加教室信息.Show
End Sub

Private Sub F2_Click()
教室信息查询.Show
End Sub

Private Sub in_Click() '数据库备份按钮
Dim aa As String
 aa = ""
 CD1.Filter = "*.mdb" '设置文件类型
 CD1.ShowOpen '打开对话框
 aa = CD1.FileName '设置文件名
 If aa <> "" Then
  Dim fso, fill
  Set fso = CreateObject("Scripting.FileSystemObject") '创建fso对象
  Set fill = fso.GetFile(App.Path + Trim("\教务管理系统.mdb"))
  fill.Copy (aa)
  bf = MsgBox("备份成功", vbOKOnly, "备份")
  CD1.FileName = ""
Else
  bf = MsgBox("你没有进行数据库的备份", vbOKOnly, "提醒")
End If
End Sub

Private Sub out_Click() '数据库恢复
 CD1.Filter = "*.mdb" '设置文件类型
 CD1.ShowOpen
Dim fso, fill
Set fso = CreateObject("Scripting.FileSystemObject") '创建fso对象
 lj = CD1.FileName
If lj <> "" Then
  qq = Right(lj, 3) '截取从右边开始3位的字符串
    If qq Like "mdb" Then
      Set fill = fso.GetFile(lj)
      fill.Copy (App.Path + Trim("\教务管理系统.mdb"))
      bf = MsgBox("还原成功", vbOKOnly, "还原")
      CD1.FileName = ""
    Else
      hh = MsgBox("请选择正确的数据库文件", vbExclamation, "提示")
    End If
Else
  hh = MsgBox("你没有进行还原!", vbExclamation, "警告")
End If
End Sub

⌨️ 快捷键说明

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