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

📄 frmspecial.frm

📁 教务辅助管理系统利用VB开发的数据库管理系统,里面分学生,教师,教务等等各方面的需求满足学校的教务管理的简单需求!
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmspecial 
   Caption         =   "专业教学计划"
   ClientHeight    =   7005
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   5835
   LinkTopic       =   "Form1"
   ScaleHeight     =   7005
   ScaleWidth      =   5835
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command7 
      Caption         =   "退出"
      Height          =   495
      Left            =   4080
      TabIndex        =   14
      Top             =   6480
      Width           =   1215
   End
   Begin VB.CommandButton Command6 
      Caption         =   "确定"
      Height          =   495
      Left            =   2400
      TabIndex        =   13
      Top             =   6480
      Width           =   1215
   End
   Begin VB.Frame Frame3 
      Caption         =   "专业课程信息查询"
      Height          =   3255
      Left            =   120
      TabIndex        =   2
      Top             =   3120
      Width           =   5175
      Begin MSDataGridLib.DataGrid DataGrid1 
         Bindings        =   "frmspecial.frx":0000
         Height          =   2175
         Left            =   120
         TabIndex        =   12
         Top             =   840
         Width           =   4935
         _ExtentX        =   8705
         _ExtentY        =   3836
         _Version        =   393216
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   330
         Left            =   600
         Top             =   1560
         Visible         =   0   'False
         Width           =   2655
         _ExtentX        =   4683
         _ExtentY        =   582
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin VB.CommandButton Command5 
         Caption         =   "查询"
         Height          =   495
         Left            =   3720
         TabIndex        =   10
         Top             =   240
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1320
         TabIndex        =   9
         Text            =   "Text1"
         Top             =   360
         Width           =   1935
      End
      Begin VB.Label Label3 
         Caption         =   "专业名称:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   360
         TabIndex        =   11
         Top             =   360
         Width           =   975
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "为某专业添加/删除课程"
      Height          =   1215
      Left            =   120
      TabIndex        =   1
      Top             =   1680
      Width           =   5175
      Begin VB.CommandButton Command4 
         BackColor       =   &H00C0C0C0&
         Caption         =   "删除课程..."
         Height          =   495
         Left            =   3720
         TabIndex        =   6
         Top             =   480
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         Caption         =   "添加课程..."
         Height          =   495
         Left            =   2280
         TabIndex        =   5
         Top             =   480
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "请点击下面的按钮..."
         Height          =   375
         Left            =   120
         TabIndex        =   8
         Top             =   720
         Width           =   2055
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "添加/删除专业"
      Height          =   1095
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   5175
      Begin VB.CommandButton Command2 
         Caption         =   "删除专业..."
         Height          =   495
         Left            =   3600
         TabIndex        =   4
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Command1 
         Caption         =   "添加专业..."
         Height          =   495
         Left            =   2160
         TabIndex        =   3
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "请点击下面的按钮..."
         Height          =   255
         Left            =   120
         TabIndex        =   7
         Top             =   600
         Width           =   2055
      End
   End
End
Attribute VB_Name = "frmspecial"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim ret As ADODB.Recordset
Dim strcnn As String

Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim dQuery As DAO.QueryDef
'添加专业 删除专业
Private Sub Command1_Click()

  Dim biaoname As String
  biaoname = InputBox("请输入表名:")
  If biaoname = "" Then
   MsgBox ("表名不能为空!!")
   End
  Else
  strcnn = "User ID=Admin;Password=;Data Source=" & App.Path & "\db.mdb;Provider=Microsoft.Jet.OLEDB.3.51"
  Set cnn = New ADODB.Connection
  cnn.Open strcnn
  Set cmd = New ADODB.Command
  cmd.ActiveConnection = cnn
  '此处需要修改
  cmd.CommandText = "create table " & Str$(biaoname) & "(课程号 int NULL,选课学期 int NULL,学时数 int NULL,考核方式 text NULL)"
  
  cmd.Execute
  
   cnn.Close
 MsgBox ("添加专业成功!!")
 End If
 
End Sub
'删除专业
Private Sub Command2_Click()
  Dim biaoname As String
  biaoname = InputBox("请输入表名:")
  If biaoname = "" Then
   MsgBox ("表名不能为空!!")
   End
  Else
  strcnn = "User ID=Admin;Password=;Data Source=" & App.Path & "\db.mdb;Provider=Microsoft.Jet.OLEDB.3.51"
  Set cnn = New ADODB.Connection
  cnn.Open strcnn
  Set cmd = New ADODB.Command
  cmd.ActiveConnection = cnn
  '此处需要修改
  cmd.CommandText = "drop table " & Str$(biaoname)
  cmd.Execute
  
   cnn.Close
 MsgBox ("添加专业成功!!")
 End If
End Sub
'添加某专业的课程
Private Sub Command3_Click()
  specialcourse.Text1.Enabled = True
  specialcourse.Text2.Enabled = True
  specialcourse.Text3.Enabled = True
  specialcourse.Text4.Enabled = True
  specialcourse.Text5.Enabled = True
  specialcourse.Text1.BackColor = &H8000000F
  specialcourse.Text2.BackColor = &H8000000F
  specialcourse.Text3.BackColor = &H8000000F
  specialcourse.Text4.BackColor = &H8000000F
  specialcourse.Text5.BackColor = &H8000000F
  specialcourse.Command1.Enabled = True
  specialcourse.Command2.Enabled = False
  
  specialcourse.Show
End Sub
'删除某专业的课程
Private Sub Command4_Click()
  specialcourse.Text1.Enabled = True
  specialcourse.Text2.Enabled = True
  specialcourse.Text3.Enabled = False
  specialcourse.Text4.Enabled = False
  specialcourse.Text5.Enabled = False
  specialcourse.Text1.BackColor = &H8000000F
  specialcourse.Text2.BackColor = &H8000000F
  specialcourse.Text3.BackColor = &HC0C0C0
  specialcourse.Text4.BackColor = &HC0C0C0
  specialcourse.Text5.BackColor = &HC0C0C0
  specialcourse.Command2.Enabled = True
  specialcourse.Command1.Enabled = False
  
  specialcourse.Show
End Sub

'查询某专业的教学计划
Private Sub Command5_Click()
  Set db = OpenDatabase(App.Path & "\db.mdb")
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from" & Str$(Text1.Text)
Adodc1.Refresh

'Set dQuery = db.CreateQueryDef("修的总课程数")
' dQuery.SQL = "select count(*) from " & Str$(Text1.Text)
'Set rec = db.OpenRecordset("修的总课程数")
 'Text2.Text = rec.Fields(0)


 DataGrid1.Visible = True
 DataGrid1.Height = 4000
 DataGrid1.Columns(0).Width = 1000
 DataGrid1.Columns(1).Width = 1000
 DataGrid1.Columns(2).Width = 1000
 DataGrid1.Columns(3).Width = 1000
End Sub
'确定
Private Sub Command6_Click()
Me.Hide
End Sub
'退出
Private Sub Command7_Click()
Me.Hide
End Sub

⌨️ 快捷键说明

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