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

📄 frmteacher.frm

📁 所在类别: 随书资源/T 工业技术/TP 自动化技术、计算机技术/TP31 计算机软件 其他题名: 作者: 夏邦贵, 刘凡馨等编著 出版者: 机械工业出版社 出版年: 2006 I
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmTeacher 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "开课教师信息管理"
   ClientHeight    =   3030
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5640
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3030
   ScaleWidth      =   5640
   Begin VB.CommandButton cmdSeek 
      Caption         =   "查找"
      Height          =   300
      Left            =   4061
      TabIndex        =   20
      Top             =   1214
      Width           =   735
   End
   Begin VB.ComboBox cmbDepart 
      Height          =   300
      Left            =   1654
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   1935
      Width           =   2010
   End
   Begin VB.TextBox txtEmail 
      Height          =   270
      IMEMode         =   2  'OFF
      Left            =   1654
      MaxLength       =   25
      TabIndex        =   3
      Top             =   1530
      Width           =   2010
   End
   Begin VB.TextBox txtPhone 
      Height          =   270
      IMEMode         =   2  'OFF
      Left            =   1654
      MaxLength       =   11
      TabIndex        =   2
      Top             =   1140
      Width           =   2010
   End
   Begin VB.TextBox txtNum 
      Height          =   270
      IMEMode         =   2  'OFF
      Left            =   1654
      MaxLength       =   6
      TabIndex        =   1
      Top             =   739
      Width           =   2010
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "保存"
      Height          =   300
      Left            =   4061
      TabIndex        =   7
      Top             =   1551
      Width           =   735
   End
   Begin VB.CommandButton cmdExit 
      Cancel          =   -1  'True
      Caption         =   "退出"
      Height          =   315
      Left            =   4061
      TabIndex        =   8
      Top             =   1890
      Width           =   735
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "删除"
      Height          =   300
      Left            =   4061
      TabIndex        =   6
      Top             =   877
      Width           =   735
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加"
      Height          =   300
      Left            =   4061
      TabIndex        =   5
      Top             =   540
      Width           =   735
   End
   Begin VB.TextBox txtName 
      Height          =   270
      IMEMode         =   1  'ON
      Left            =   1654
      MaxLength       =   10
      TabIndex        =   0
      Top             =   338
      Width           =   2010
   End
   Begin VB.PictureBox picNavigation 
      AutoSize        =   -1  'True
      BorderStyle     =   0  'None
      Height          =   360
      Left            =   1016
      ScaleHeight     =   360
      ScaleWidth      =   2685
      TabIndex        =   13
      Top             =   2333
      Width           =   2685
      Begin VB.CommandButton cmdMove 
         Caption         =   "<"
         Height          =   300
         Index           =   1
         Left            =   360
         Picture         =   "frmTeacher.frx":0000
         TabIndex        =   10
         Top             =   15
         Width           =   345
      End
      Begin VB.CommandButton cmdMove 
         Caption         =   "|<"
         Height          =   300
         Index           =   0
         Left            =   30
         Picture         =   "frmTeacher.frx":0045
         TabIndex        =   9
         Top             =   15
         Width           =   345
      End
      Begin VB.CommandButton cmdMove 
         Caption         =   ">|"
         Height          =   300
         Index           =   3
         Left            =   2280
         Picture         =   "frmTeacher.frx":0092
         TabIndex        =   12
         Top             =   15
         Width           =   345
      End
      Begin VB.CommandButton cmdMove 
         Caption         =   ">"
         Height          =   300
         Index           =   2
         Left            =   1950
         Picture         =   "frmTeacher.frx":00E1
         TabIndex        =   11
         Top             =   15
         Width           =   345
      End
      Begin VB.TextBox txtNews 
         Height          =   300
         Left            =   690
         Locked          =   -1  'True
         TabIndex        =   14
         TabStop         =   0   'False
         Top             =   15
         Width           =   1275
      End
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "所属系部"
      Height          =   180
      Left            =   844
      TabIndex        =   19
      Top             =   2003
      Width           =   720
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "Email"
      Height          =   180
      Left            =   844
      TabIndex        =   18
      Top             =   1586
      Width           =   450
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "联系电话"
      Height          =   180
      Left            =   844
      TabIndex        =   17
      Top             =   1185
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "教师编号"
      Height          =   180
      Left            =   859
      TabIndex        =   16
      Top             =   784
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "教师姓名"
      Height          =   180
      Left            =   844
      TabIndex        =   15
      Top             =   383
      Width           =   720
   End
End
Attribute VB_Name = "frmTeacher"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim isAdding As Boolean             '定义操作状态标志
Dim objTeacher As Recordset         '用于保存数据库中的教师信息记录
Dim objDepart As Recordset          '用于保存系部编号和名称
Dim objCn As Connection             '用于建立数据库联接

Private Sub cmdExit_Click()
    Unload Me                       '关闭教师信息管理窗体
End Sub

Private Sub cmdSeek_Click()
   Dim strKey$
    strKey = InputBox("请输入要查询的教师姓名或开头字符!", "查询教师")
    If strKey = "" Then
        MsgBox "输入无效!", vbInformation, "教师信息管理"
    Else
        With objTeacher
            If .RecordCount > 0 Then
                .MoveFirst
                .Find "姓名 like '" & strKey & "*'"
                If .EOF Then
                    MsgBox "无姓名为 " & strKey & " 的教师信息记录!", vbInformation, "教师信息管理"
                Else
                    '显示当前记录数据
                    ShowData
                End If
            Else
                MsgBox "教师信息记录!", vbInformation, "教师信息管理"
            End If
        End With
    End If
End Sub

Private Sub Form_Load()
    '建立数据库联接
    Set objCn = New Connection                 '实例化联接对象
    With objCn                                 '建立数据库联接
        .Provider = "SQLOLEDB"
        .ConnectionString = "User ID=sa;PWD=123;Data Source=(local);" & _
                            "Initial Catalog=学分制选课"
        .Open
    End With
    '获取教师信息记录
    Set objTeacher = New Recordset               '实例化objTeacher对象
    With objTeacher
        Set .ActiveConnection = objCn           '设置数据库联接
        .CursorLocation = adUseClient           '指定使用客户端游标
        .CursorType = adOpenStatic              '指定使用静态游标
        .LockType = adLockOptimistic
        .Open "SELECT * FROM 教师信息"          '获取教师信息记录
    End With
    '获取系部编号和名称
    Set objDepart = New Recordset               '实例化objDepart对象
    With objDepart
        Set .ActiveConnection = objCn           '设置数据库联接

⌨️ 快捷键说明

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