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

📄 frmcourseinfo.frm

📁 vb作的学生信息管理系统!非常好用,sdg dfh fgh f
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAddcourseinfo 
   Caption         =   "添加课程信息"
   ClientHeight    =   3612
   ClientLeft      =   48
   ClientTop       =   348
   ClientWidth     =   7344
   LinkTopic       =   "Form1"
   ScaleHeight     =   3612
   ScaleWidth      =   7344
   StartUpPosition =   3  'Windows Default
   Begin VB.ComboBox comboCoursetype 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   312
      Left            =   1560
      TabIndex        =   9
      Top             =   1200
      Width           =   1332
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消添加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   3840
      TabIndex        =   8
      Top             =   2760
      Width           =   1452
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认添加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   1320
      TabIndex        =   7
      Top             =   2760
      Width           =   1452
   End
   Begin VB.TextBox txtCoursedes 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1452
      Left            =   4680
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   6
      Top             =   1080
      Width           =   2412
   End
   Begin VB.TextBox txtCoursename 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   4680
      TabIndex        =   3
      Top             =   240
      Width           =   1332
   End
   Begin VB.TextBox txtCourseno 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   1560
      TabIndex        =   1
      Top             =   240
      Width           =   1332
   End
   Begin VB.Label Label4 
      Caption         =   "课程描述:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   3360
      TabIndex        =   5
      Top             =   1200
      Width           =   1212
   End
   Begin VB.Label Label3 
      Caption         =   "课程类型:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   240
      TabIndex        =   4
      Top             =   1200
      Width           =   1212
   End
   Begin VB.Label Label2 
      Caption         =   "课程名称:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   3360
      TabIndex        =   2
      Top             =   360
      Width           =   1212
   End
   Begin VB.Label Label1 
      Caption         =   "课程编号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   252
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   1212
   End
End
Attribute VB_Name = "frmAddcourseinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim mrc As ADODB.Recordset
    Dim MsgText As String
    Dim txtSQL As String
    
    If Not Testtxt(txtCourseno.Text) Then
        MsgBox "请输入课程编号!", vbOKOnly + vbExclamation, "警告"
        txtCourseno.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(txtCoursename.Text) Then
        MsgBox "请输入课程名称!", vbOKOnly + vbExclamation, "警告"
        txtCoursename.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(comboCoursetype.Text) Then
        MsgBox "请选择课程类型!", vbOKOnly + vbExclamation, "警告"
        comboCoursetype.SetFocus
        Exit Sub
    End If
    
        
    If Not Testtxt(txtCoursedes.Text) Then
        MsgBox "请输入课程描述信息!", vbOKOnly + vbExclamation, "警告"
        txtCoursedes.SetFocus
        Exit Sub
    End If
    
    If Not IsNumeric(Trim(txtCourseno.Text)) Then
        MsgBox "请输入数字编号!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
        txtCourseno.SetFocus
    End If
    
    txtSQL = "select * from course_Info "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    
    While (mrc.EOF = False)
        If (Trim(mrc.Fields(0)) = Trim(txtCourseno.Text)) Then
            MsgBox "课程编号已经存在,请重新输入课程编号!", vbOKOnly + vbExclamation, "警告"
            txtCourseno.Text = ""
            txtCourseno.SetFocus
            Exit Sub
        Else
            mrc.MoveNext
        End If
    Wend
    
    mrc.AddNew
    mrc.Fields(0) = Trim(txtCourseno.Text)
    mrc.Fields(1) = Trim(txtCoursename.Text)
    mrc.Fields(2) = Trim(comboCoursetype.Text)
    mrc.Fields(3) = Trim(txtCoursedes.Text)
    mrc.Update
    mrc.Close
    MsgBox "添加课程信息成功!", vbOKOnly + vbExclamation, "添加课程信息"
    Unload Me
    
    
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    comboCoursetype.AddItem "必修"
    comboCoursetype.AddItem "考查"
    
End Sub

⌨️ 快捷键说明

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