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

📄 modifycj.frm

📁 这是一个我帮师妹做的软件的大作业
💻 FRM
字号:
VERSION 5.00
Begin VB.Form modifyCj 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "修改成绩信息"
   ClientHeight    =   3705
   ClientLeft      =   6345
   ClientTop       =   4335
   ClientWidth     =   4680
   Icon            =   "modifyCj.frx":0000
   LinkTopic       =   "Form3"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3705
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command5 
      Caption         =   "更新数据"
      Height          =   375
      Left            =   1080
      TabIndex        =   13
      Top             =   3240
      Width           =   855
   End
   Begin VB.CommandButton Command4 
      Caption         =   "删除信息"
      Height          =   375
      Left            =   2760
      TabIndex        =   12
      Top             =   3240
      Width           =   855
   End
   Begin VB.CommandButton Command3 
      Caption         =   "取消修改"
      Height          =   375
      Left            =   1920
      TabIndex        =   11
      Top             =   3240
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Height          =   3015
      Left            =   0
      TabIndex        =   2
      Top             =   0
      Width           =   4815
      Begin VB.Frame Frame4 
         Caption         =   "学期:"
         Height          =   615
         Left            =   120
         TabIndex        =   9
         Top             =   840
         Width           =   2775
         Begin VB.ComboBox Combo1 
            BackColor       =   &H80000018&
            Height          =   300
            Index           =   3
            ItemData        =   "modifyCj.frx":08CA
            Left            =   600
            List            =   "modifyCj.frx":08E6
            Style           =   2  'Dropdown List
            TabIndex        =   10
            Top             =   180
            Width           =   2055
         End
      End
      Begin VB.Frame Frame2 
         Caption         =   "学号:"
         Height          =   615
         Left            =   120
         TabIndex        =   7
         Top             =   120
         Width           =   2775
         Begin VB.ComboBox Combo1 
            BackColor       =   &H80000018&
            Height          =   300
            Index           =   0
            ItemData        =   "modifyCj.frx":094A
            Left            =   600
            List            =   "modifyCj.frx":094C
            Style           =   2  'Dropdown List
            TabIndex        =   8
            Top             =   180
            Width           =   2055
         End
      End
      Begin VB.Frame Frame3 
         Caption         =   "课程名称:"
         Height          =   615
         Left            =   120
         TabIndex        =   5
         Top             =   1560
         Width           =   2775
         Begin VB.ComboBox Combo1 
            BackColor       =   &H80000018&
            Height          =   300
            Index           =   1
            ItemData        =   "modifyCj.frx":094E
            Left            =   600
            List            =   "modifyCj.frx":0950
            Style           =   2  'Dropdown List
            TabIndex        =   6
            Top             =   180
            Width           =   2055
         End
      End
      Begin VB.Frame Frame5 
         Caption         =   "分数:"
         Height          =   615
         Left            =   120
         TabIndex        =   3
         Top             =   2280
         Width           =   2775
         Begin VB.TextBox Text3 
            Appearance      =   0  'Flat
            BackColor       =   &H80000018&
            Enabled         =   0   'False
            Height          =   320
            Left            =   600
            TabIndex        =   4
            Top             =   180
            Width           =   2020
         End
      End
      Begin VB.Image Image1 
         Height          =   2655
         Left            =   3240
         Picture         =   "modifyCj.frx":0952
         Stretch         =   -1  'True
         Top             =   240
         Width           =   1335
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改信息"
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   3240
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   375
      Left            =   3600
      TabIndex        =   0
      Top             =   3240
      Width           =   855
   End
End
Attribute VB_Name = "modifyCj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click(Index As Integer)
Select Case Index
Case 3
txtSQL = "select 课程名称 from zpcourse where 学期='" & Trim(Combo1(3).Text) & "'"
Set mrc1 = ExecuteSQL(txtSQL)
If mrc1.EOF = True Then
Exit Sub
End If
 mrc1.MoveFirst
 Combo1(1).Clear
Do Until mrc1.EOF
   Combo1(1).AddItem mrc1.Fields(0)
  mrc1.MoveNext
Loop
Set mrc1 = Nothing
End Select
End Sub

Private Sub Command1_Click()
Frame2.Enabled = False
Frame3.Enabled = False
Frame4.Enabled = False
Text3.Enabled = True
Dim mrc As ADODB.Recordset
txtSQL = "select 成绩 from cj where 学号='" & Trim(Combo1(0).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "' and 课程名称='" & Trim(Combo1(1).Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = True Then
Exit Sub
End If
mrc.MoveFirst
Text3.Text = mrc.Fields(0)
Set mrc = Nothing

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Frame2.Enabled = True
Frame3.Enabled = True
Frame4.Enabled = True
Text3.Text = ""
Text3.Enabled = False
End Sub

Private Sub Command4_Click()
Dim mrc As ADODB.Recordset
txtSQL = "select 成绩 from cj where 学号='" & Trim(Combo1(0).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "' and 课程名称='" & Trim(Combo1(1).Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = True Then
Exit Sub
End If
mrc.MoveFirst
Text3.Text = mrc.Fields(0)
Set mrc = Nothing

str2$ = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")
    If str2$ = vbOK Then
   txtSQL = "select * from cj where 学号='" & Trim(Combo1(0).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "' and 课程名称='" & Trim(Combo1(1).Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
mrc.Delete
    s = MsgBox("删除记录完毕!", vbOKCancel, "删除成功")
Frame2.Enabled = True
Frame3.Enabled = True
Frame4.Enabled = True
Text3.Text = ""
Text3.Enabled = False
End If
End Sub

Private Sub Command5_Click()
If Not Testtxt(Text3.Text) Then
MsgBox "还没有输入分数呢!!", vbOKOnly + vbExclamation, "警告"
Text3.SetFocus
Exit Sub
End If
Dim mrc As ADODB.Recordset
txtSQL = "select * from cj where 学号='" & Trim(Combo1(0).Text) & "' and 学期='" & Trim(Combo1(3).Text) & "' and 课程名称='" & Trim(Combo1(1).Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
mrc.Delete
mrc.AddNew
 mrc.Fields(1) = Combo1(0).Text
   mrc.Fields(2) = Trim(Combo1(3).Text)
   mrc.Fields(3) = Trim(Combo1(1).Text)
   mrc.Fields(4) = Val(Trim(Text3.Text))

mrc.Update
MsgBox "修改信息成功!", vbOKOnly + vbExclamation, "警告"
Frame2.Enabled = True
Frame3.Enabled = True
Frame4.Enabled = True
Text3.Text = ""
Text3.Enabled = False
End Sub

Private Sub Form_Load()
Dim mrc As ADODB.Recordset
txtSQL = "select 学号 from stud"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = True Then
Exit Sub
End If
 mrc.MoveFirst
Do Until mrc.EOF
   Combo1(0).AddItem mrc.Fields(0)
 mrc.MoveNext
Loop
Set mrc = Nothing

End Sub

Private Sub Form_Unload(Cancel As Integer)
frmMain.Enabled = True
End Sub

⌨️ 快捷键说明

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