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

📄 frmscore1.frm

📁 用VB实现的一个学生管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash8a.ocx"
Begin VB.Form frmscore1 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "修改成绩"
   ClientHeight    =   5040
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5475
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5040
   ScaleWidth      =   5475
   Begin VB.ComboBox cobcollege 
      Height          =   300
      Left            =   1080
      TabIndex        =   26
      Text            =   "cobcollege"
      Top             =   2160
      Width           =   1335
   End
   Begin VB.ComboBox cobhalf 
      Height          =   300
      Left            =   3960
      TabIndex        =   13
      Text            =   "cobhalf"
      Top             =   3120
      Width           =   1335
   End
   Begin VB.ComboBox cobteacher 
      Height          =   300
      Left            =   3960
      TabIndex        =   12
      Text            =   "cobteacher"
      Top             =   2640
      Width           =   1335
   End
   Begin VB.ComboBox cobyear 
      Height          =   300
      Left            =   1080
      TabIndex        =   11
      Text            =   "cobyear"
      Top             =   3600
      Width           =   1335
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "修改下一学生"
      Height          =   375
      Left            =   2800
      TabIndex        =   10
      Top             =   4440
      Width           =   1215
   End
   Begin VB.CommandButton cmdQuit 
      Caption         =   "退出修改"
      Height          =   375
      Left            =   4200
      TabIndex        =   9
      Top             =   4440
      Width           =   1095
   End
   Begin VB.CommandButton add 
      Caption         =   "确认修改"
      Height          =   375
      Left            =   120
      TabIndex        =   8
      Top             =   4440
      Width           =   1095
   End
   Begin VB.TextBox txtscore 
      Height          =   270
      Left            =   1080
      TabIndex        =   7
      Text            =   "txtscore"
      Top             =   4080
      Width           =   1335
   End
   Begin VB.ComboBox cobread 
      Height          =   300
      Left            =   3960
      TabIndex        =   6
      Text            =   "cobread"
      Top             =   3600
      Width           =   1335
   End
   Begin VB.ComboBox coblesson 
      Height          =   300
      Left            =   1080
      TabIndex        =   5
      Text            =   "coblesson"
      Top             =   3120
      Width           =   1335
   End
   Begin VB.ComboBox cobclass 
      Height          =   300
      Left            =   1080
      TabIndex        =   4
      Text            =   "cobclass"
      Top             =   2640
      Width           =   1335
   End
   Begin VB.ComboBox cobsp 
      Height          =   300
      Left            =   3960
      TabIndex        =   3
      Text            =   "cobsp"
      Top             =   2160
      Width           =   1335
   End
   Begin VB.TextBox txtname 
      Height          =   270
      Left            =   3960
      TabIndex        =   2
      Text            =   "txtname"
      Top             =   1680
      Width           =   1335
   End
   Begin VB.TextBox txtnumber 
      Height          =   270
      Left            =   1080
      TabIndex        =   1
      Text            =   "txtnumber"
      Top             =   1680
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "取消修改"
      Height          =   375
      Left            =   1400
      TabIndex        =   0
      Top             =   4440
      Width           =   1215
   End
   Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1 
      Height          =   1575
      Left            =   -120
      TabIndex        =   24
      Top             =   0
      Width           =   5655
      _cx             =   9975
      _cy             =   2778
      FlashVars       =   ""
      Movie           =   ""
      Src             =   ""
      WMode           =   "Window"
      Play            =   -1  'True
      Loop            =   -1  'True
      Quality         =   "High"
      SAlign          =   ""
      Menu            =   -1  'True
      Base            =   ""
      AllowScriptAccess=   ""
      Scale           =   "ShowAll"
      DeviceFont      =   0   'False
      EmbedMovie      =   0   'False
      BGColor         =   ""
      SWRemote        =   ""
      MovieData       =   ""
      SeamlessTabbing =   -1  'True
      Profile         =   0   'False
      ProfileAddress  =   ""
      ProfilePort     =   0
   End
   Begin VB.Label Label11 
      BackColor       =   &H00FFFFFF&
      Caption         =   "学    院:"
      Height          =   255
      Left            =   120
      TabIndex        =   25
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label10 
      BackColor       =   &H00FFFFFF&
      Caption         =   "学    期:"
      Height          =   255
      Left            =   2880
      TabIndex        =   23
      Top             =   3120
      Width           =   1095
   End
   Begin VB.Label label9 
      BackColor       =   &H00FFFFFF&
      Caption         =   "授课老师:"
      Height          =   255
      Left            =   2880
      TabIndex        =   22
      Top             =   2640
      Width           =   1095
   End
   Begin VB.Label Label8 
      BackColor       =   &H00FFFFFF&
      Caption         =   "成    绩:"
      Height          =   255
      Left            =   120
      TabIndex        =   21
      Top             =   4080
      Width           =   975
   End
   Begin VB.Label Label7 
      BackColor       =   &H00FFFFFF&
      Caption         =   "重    修:"
      Height          =   255
      Left            =   2880
      TabIndex        =   20
      Top             =   3600
      Width           =   1095
   End
   Begin VB.Label label6 
      BackColor       =   &H00FFFFFF&
      Caption         =   "学    年:"
      Height          =   255
      Left            =   120
      TabIndex        =   19
      Top             =   3600
      Width           =   975
   End
   Begin VB.Label Label5 
      BackColor       =   &H00FFFFFF&
      Caption         =   "课程名称:"
      Height          =   255
      Left            =   120
      TabIndex        =   18
      Top             =   3120
      Width           =   975
   End
   Begin VB.Label Label4 
      BackColor       =   &H00FFFFFF&
      Caption         =   "班    级:"
      Height          =   255
      Left            =   120
      TabIndex        =   17
      Top             =   2640
      Width           =   975
   End
   Begin VB.Label Label3 
      BackColor       =   &H00FFFFFF&
      Caption         =   "专    业:"
      Height          =   255
      Left            =   2880
      TabIndex        =   16
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFFFFF&
      Caption         =   "姓    名:"
      Height          =   255
      Left            =   2880
      TabIndex        =   15
      Top             =   1680
      Width           =   975
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FFFFFF&
      Caption         =   "学    号:"
      Height          =   255
      Left            =   120
      TabIndex        =   14
      Top             =   1680
      Width           =   975
   End
End
Attribute VB_Name = "frmscore1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 Dim tnumber As String
 Dim tlesson As String

Private Sub add_Click()
Dim SQL As String
On Error GoTo errMsg



If cobclass.Text = "" Then

   MsgBox "班别不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If

If coblesson.Text = "" Then

   MsgBox "课程不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If


SQL = MsgBox("你真的要修改当前数据吗,请慎重处理!", vbInformation _
     + vbOKCancel + vbDefaultButton2, "系统提示")
If SQL = vbCancel Then
  Exit Sub
End If
'课号
If Trim(txtnumber.Text) = "" Then
   MsgBox "学号号不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txtnumber.SetFocus
   Exit Sub
End If
'姓名
If Trim(txtname.Text) = "" Then
   MsgBox "姓名不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txtname.SetFocus
   Exit Sub
End If
'成绩
If Trim(txtscore.Text) = "" Then
   MsgBox "成绩不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txtscore.SetFocus
   Exit Sub
End If
If Trim(txtscore.Text) > 100 Or Trim(txtscore.Text) < 0 Then
   MsgBox "成绩必须在0-100之间,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txtscore.SetFocus
   Exit Sub
End If
SQL = ""
SQL = "update score set 学号='" & Trim(txtnumber.Text) & "',"
SQL = SQL & "姓名='" & Trim(txtname.Text) & "',"
SQL = SQL & "学院='" & Trim(cobcollege.Text) & "',"
SQL = SQL & "专业='" & Trim(cobsp.Text) & "',"
SQL = SQL & "班级='" & Trim(cobclass.Text) & "',"
SQL = SQL & "课程='" & Trim(coblesson.Text) & "',"
SQL = SQL & "授课教师='" & Trim(cobteacher.Text) & "',"
SQL = SQL & "重修='" & Trim(cobread.Text) & "',"
SQL = SQL & "学年='" & Trim(cobyear.Text) & "',"
SQL = SQL & "学期='" & Trim(cobhalf.Text) & "',"
SQL = SQL & "成绩='" & Trim(txtscore.Text) & "'"
SQL = SQL & " Where 学号='" & Trim(tnumber) & "' and 课程='" & Trim(tlesson) & "'"
adoCon.Execute (SQL)

SQL = MsgBox("修改成功!", vbInformation _
     + vbOK, "系统提示")

Command1.Enabled = False
errMsg:
  If Err.Number <> 0 Then
     MsgBox Err.Description, , "系统错误"
  End If
  
End Sub




  

Private Sub cmdCancel_Click()
Unload Me
frmupdatescore.Show
End Sub

Private Sub cmdQuit_Click()
Unload Me

End Sub


Private Sub cobcollege_Click()
'专业
SQL = ""
SQL = "select 专业 from Spcollege where  学院='" & cobcollege.Text & "'"
Set adoRS = adoCon.Execute(SQL)

cobsp.Clear
Do While Not adoRS.EOF
  cobsp.AddItem Trim(adoRS("专业"))
  adoRS.MoveNext
Loop
cobsp.ListIndex = 0
End Sub

Private Sub cobsp_Click()
'班级
SQL = ""
SQL = "select 班级 from Spclass where  专业='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(SQL)

cobclass.Clear
Do While Not adoRS.EOF
  cobclass.AddItem Trim(adoRS("班级"))
  adoRS.MoveNext
Loop
cobclass.ListIndex = 0

'lesson
SQL = ""
SQL = "select 课程 from Splesson where  专业='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(SQL)

coblesson.Clear
Do While Not adoRS.EOF
  coblesson.AddItem Trim(adoRS("课程"))
  adoRS.MoveNext
Loop
coblesson.ListIndex = 0

End Sub

Private Sub Combo1_Change()

End Sub

Private Sub Command1_Click()
  fillRecord1
End Sub

Private Sub Form_Load()
Me.Height = 5520
Me.Width = 5565
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
 FillControl1
   ShockwaveFlash1.Movie = App.Path & "\flash\top.swf"

    fillRecord1
End Sub
Private Sub FillControl1()
txtnumber.Text = ""
txtname.Text = ""
txtscore.Text = ""

'教师
Set adoRS = adoCon.Execute("Select Name From Teacher Order By Name")
cobteacher.Clear
Do While Not adoRS.EOF
  cobteacher.AddItem Trim(adoRS("Name"))
  adoRS.MoveNext
Loop
cobteacher.ListIndex = 0
'学院
Set adoRS = adoCon.Execute("Select Name From College Order By Name")
cobcollege.Clear
Do While Not adoRS.EOF
  cobcollege.AddItem Trim(adoRS("Name"))
  adoRS.MoveNext
Loop
cobcollege.ListIndex = 0
'重修
With cobread
  .Clear
  .AddItem "否"
  .AddItem "是"
  .ListIndex = 0
End With
'学年
With cobyear
 .Clear
 For i = 1990 To 2020
 .AddItem i & "年"
 Next i
    .ListIndex = 0
End With
'学期
With cobhalf
.Clear
.AddItem "上学期"
.AddItem "下学期"
.ListIndex = 0
End With

'lesson
SQL = ""
SQL = "select 课程 from Splesson where  专业='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(SQL)

coblesson.Clear
Do While Not adoRS.EOF
  coblesson.AddItem Trim(adoRS("课程"))
  adoRS.MoveNext
Loop
coblesson.ListIndex = 0
End Sub
Private Sub fillRecord1()
 
 Dim SQL As String
 
 SQL = "select * from score where 学号='" & frmupdatescore.sk2 & "' and 课程='" & frmupdatescore.sk3 & "'"

 Set adoRS = adoCon.Execute(SQL)
 txtnumber.Text = Trim(adoRS("学号"))
 tnumber = Trim(adoRS("学号"))
 coblesson.Text = Trim(adoRS("课程"))
 tlesson = Trim(adoRS("课程"))
 cobteacher.Text = Trim(adoRS("授课教师"))
 txtscore.Text = Trim(adoRS("成绩"))
 txtname.Text = Trim(adoRS("姓名"))
 cobclass.Text = Trim(adoRS("班级"))
 cobsp.Text = Trim(adoRS("专业"))
 cobread.Text = Trim(adoRS("重修"))
 cobyear.Text = Trim(adoRS("学年"))
  cobhalf.Text = Trim(adoRS("学期"))
  cobcollege.Text = Trim(adoRS("学院"))
 
 Set adoRS = Nothing
 
 
 

End Sub

⌨️ 快捷键说明

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