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

📄 form9.frm

📁 本软件界面友好
💻 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 Form9 
   Caption         =   "Form9"
   ClientHeight    =   4095
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5610
   LinkTopic       =   "Form9"
   ScaleHeight     =   4095
   ScaleWidth      =   5610
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "删除科目"
      Height          =   375
      Left            =   1920
      TabIndex        =   6
      Top             =   3240
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Caption         =   "选择班级"
      Height          =   855
      Left            =   480
      TabIndex        =   0
      Top             =   480
      Width           =   4335
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   600
         TabIndex        =   2
         Text            =   "Combo1"
         Top             =   360
         Width           =   2295
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "科目管理"
      Height          =   3735
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   5175
      Begin VB.Frame Frame3 
         Caption         =   "科目管理"
         Height          =   2295
         Left            =   360
         TabIndex        =   3
         Top             =   1320
         Width           =   4335
         Begin VB.CommandButton Command3 
            Caption         =   "关闭"
            Height          =   375
            Left            =   2760
            TabIndex        =   7
            Top             =   1800
            Width           =   855
         End
         Begin VB.CommandButton Command1 
            Caption         =   "增加科目"
            Height          =   375
            Left            =   240
            TabIndex        =   5
            Top             =   1800
            Width           =   975
         End
         Begin MSDataGridLib.DataGrid DataGrid1 
            Height          =   1455
            Left            =   240
            TabIndex        =   4
            Top             =   240
            Width           =   3495
            _ExtentX        =   6165
            _ExtentY        =   2566
            _Version        =   393216
            HeadLines       =   1
            RowHeight       =   15
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               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          =   375
            Left            =   720
            Top             =   1080
            Width           =   2175
            _ExtentX        =   3836
            _ExtentY        =   661
            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            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _Version        =   393216
         End
      End
   End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset

Private Sub Combo1_Click()
    Set rs = New Recordset
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\student.mdb;Persist Security Info=False"
    Adodc1.CommandType = adCmdText
    sql = "select 成绩科目,班级ID from 成绩科目 where 班级ID = '" & Combo1.Text & "'order by id desc"
    Adodc1.RecordSource = sql
    Adodc1.Refresh
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.Refresh
    Adodc1.Tag = 0
End Sub

Private Sub Command1_Click()
    Adodc1.Recordset.AddNew
End Sub

Private Sub Command2_Click()
    If MsgBox("真的要删除吗?", vbYesNo, "") = vbYes Then
       If Adodc1.Recordset.EOF Then
       'Adodc1.Recordset.MoveFirst
       Else
          Adodc1.Recordset.Delete
          'Adodc1.Recordset.MoveNext
 
       End If
    End If
    Adodc1.Tag = 0

End Sub

Private Sub Command3_Click()
    Me.Hide
    
End Sub

Private Sub Form_Load()
    conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\student.mdb;Persist Security Info=False"
    conn.Open
    rs.Open "select * from 班级", conn
    
    Do While Not rs.EOF
        Combo1.AddItem (rs("班级"))
        rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing

End Sub

⌨️ 快捷键说明

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