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

📄 frmadddepartinfo.frm

📁 数据库管理系统的实习内容
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAdddepartinfo 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "山东大学院系信息添加"
   ClientHeight    =   4275
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5355
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4275
   ScaleWidth      =   5355
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定(&O)"
      Height          =   375
      Left            =   360
      TabIndex        =   5
      Top             =   3600
      Width           =   975
   End
   Begin VB.CommandButton cmdRefresh 
      Caption         =   "刷新(&R)"
      Height          =   375
      Left            =   2160
      TabIndex        =   4
      Top             =   3600
      Width           =   975
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&X)"
      Height          =   375
      Left            =   3840
      TabIndex        =   3
      Top             =   3600
      Width           =   975
   End
   Begin VB.TextBox txtDepartdes 
      Height          =   1095
      Left            =   1680
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   2040
      Width           =   2655
   End
   Begin VB.TextBox txtDepartname 
      Height          =   375
      Left            =   1680
      TabIndex        =   1
      Top             =   1320
      Width           =   2655
   End
   Begin VB.TextBox txtDepartno 
      Height          =   375
      Left            =   1680
      TabIndex        =   0
      Top             =   600
      Width           =   2655
   End
   Begin VB.Frame Frame1 
      Caption         =   "院系信息"
      Height          =   3255
      Left            =   360
      TabIndex        =   6
      Top             =   120
      Width           =   4455
      Begin VB.Label Label1 
         Caption         =   "院系号"
         Height          =   375
         Left            =   360
         TabIndex        =   9
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "院系名"
         Height          =   495
         Left            =   360
         TabIndex        =   8
         Top             =   1200
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "院系描述"
         Height          =   375
         Left            =   360
         TabIndex        =   7
         Top             =   1920
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frmAdddepartinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click()
    Dim mrc As ADODB.Recordset
    Dim MsgText As String
    Dim txtSQL As String
    
    If Not Testtxt(txtDepartno.Text) Then
        MsgBox "请输入课程编号!", vbOKOnly + vbExclamation, "提示"
        txtDepartno.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(txtDepartname.Text) Then
        MsgBox "请输入课程名称!", vbOKOnly + vbExclamation, "提示"
        txtDepartname.SetFocus
        Exit Sub
    End If
        
    If Not Testtxt(txtDepartdes.Text) Then
        MsgBox "请输入课程描述信息!", vbOKOnly + vbExclamation, "提示"
        txtDepartdes.SetFocus
        Exit Sub
    End If
    
    If Not IsNumeric(Trim(txtDepartno.Text)) Then
        MsgBox "请输入数字编号!", vbOKOnly + vbExclamation, "提示"
        Exit Sub
        txtDepartno.SetFocus
    End If
    
    txtSQL = "select * from college_Info "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    
    While (mrc.EOF = False)
        If (Trim(mrc.Fields(0)) = Trim(txtDepartno.Text)) Then
            MsgBox "课程编号已经存在,请重新输入课程编号!", vbOKOnly + vbExclamation, "提示"
            txtDepartno.Text = ""
            txtDepartno.SetFocus
            Exit Sub
        Else
            mrc.MoveNext
        End If
    Wend
    
    mrc.AddNew
    mrc.Fields(0) = Trim(txtDepartno.Text)
    mrc.Fields(1) = Trim(txtDepartname.Text)
    mrc.Fields(2) = Trim(txtDepartdes.Text)
    mrc.Update
    mrc.Close
    MsgBox "添加院系信息成功!", vbOKOnly + vbExclamation, "添加院系信息"
    
    
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdRefresh_Click()
    txtDepartno.Text = ""
    txtDepartname.Text = ""
    txtDepartdes.Text = ""
End Sub

⌨️ 快捷键说明

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