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

📄 frmlessonupdate.frm

📁 学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash8a.ocx"
Begin VB.Form frmlessonUpdate 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "课程信息修改"
   ClientHeight    =   3075
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4980
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3075
   ScaleWidth      =   4980
   Begin VB.TextBox txtlesson 
      Height          =   270
      Left            =   3600
      TabIndex        =   15
      Top             =   1200
      Width           =   1215
   End
   Begin VB.ComboBox cobteacher 
      Height          =   300
      Left            =   1080
      TabIndex        =   14
      Text            =   "cobteacher"
      Top             =   1680
      Width           =   1215
   End
   Begin VB.TextBox txtNumber 
      DataField       =   "课程编号"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   1080
      TabIndex        =   7
      Top             =   1200
      Width           =   1215
   End
   Begin VB.CommandButton cmdUpdate 
      Caption         =   "确认修改"
      Height          =   375
      Left            =   120
      TabIndex        =   5
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出修改"
      Height          =   375
      Left            =   3720
      TabIndex        =   4
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消修改"
      Height          =   375
      Left            =   1320
      TabIndex        =   3
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton next 
      Caption         =   "修改下一个"
      Height          =   375
      Left            =   2520
      TabIndex        =   1
      Top             =   2640
      Width           =   1095
   End
   Begin VB.ComboBox cobclass 
      Height          =   300
      Left            =   3600
      TabIndex        =   0
      Text            =   "cobclass"
      Top             =   2160
      Width           =   1215
   End
   Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1 
      Height          =   1215
      Left            =   -120
      TabIndex        =   16
      Top             =   -120
      Width           =   5175
      _cx             =   9128
      _cy             =   2143
      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 MSComCtl2.UpDown UpDown1 
      Height          =   255
      Left            =   2040
      TabIndex        =   17
      Top             =   2160
      Width           =   255
      _ExtentX        =   450
      _ExtentY        =   450
      _Version        =   393216
      Value           =   1
      Max             =   100
      Enabled         =   -1  'True
   End
   Begin MSComCtl2.UpDown UpDown2 
      Height          =   255
      Left            =   4560
      TabIndex        =   18
      Top             =   1680
      Width           =   255
      _ExtentX        =   450
      _ExtentY        =   450
      _Version        =   393216
      Value           =   1
      Enabled         =   -1  'True
   End
   Begin VB.TextBox txttime 
      Height          =   270
      Left            =   1080
      TabIndex        =   2
      Top             =   2160
      Width           =   1215
   End
   Begin VB.TextBox txtmark 
      DataField       =   "学分"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   3600
      TabIndex        =   6
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FFFFFF&
      Caption         =   "课程编号:"
      Height          =   195
      Left            =   120
      TabIndex        =   13
      Top             =   1200
      Width           =   945
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFFFFF&
      Caption         =   "课程名称:"
      Height          =   195
      Left            =   2520
      TabIndex        =   12
      Top             =   1200
      Width           =   945
   End
   Begin VB.Label Label3 
      BackColor       =   &H00FFFFFF&
      Caption         =   "授课老师:"
      Height          =   240
      Left            =   120
      TabIndex        =   11
      Top             =   1680
      Width           =   945
   End
   Begin VB.Label Label4 
      BackColor       =   &H00FFFFFF&
      Caption         =   "学    分:"
      Height          =   240
      Left            =   2520
      TabIndex        =   10
      Top             =   1680
      Width           =   945
   End
   Begin VB.Label Label5 
      BackColor       =   &H00FFFFFF&
      Caption         =   "课    时:"
      Height          =   255
      Left            =   120
      TabIndex        =   9
      Top             =   2160
      Width           =   975
   End
   Begin VB.Label Label6 
      BackColor       =   &H00FFFFFF&
      Caption         =   "对象班级:"
      Height          =   255
      Left            =   2520
      TabIndex        =   8
      Top             =   2160
      Width           =   975
   End
End
Attribute VB_Name = "frmlessonUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 Dim tnumber As String
Private Sub cmdupdate_Click()
Dim SQL As String
On Error GoTo errMsg
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(txtlesson.Text) = "" Then
   MsgBox "课程名称不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txtlesson.SetFocus
   Exit Sub
End If

'课时
If Trim(txttime.Text) = "" Then
   MsgBox "课时不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txttime.SetFocus
   Exit Sub
End If
'学分
If Trim(txtmark.Text) = "" Then
   MsgBox "学分不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
   txtmark.SetFocus
   Exit Sub
End If

SQL = ""
SQL = "update Lesson set 课程编号='" & Trim(txtnumber.Text) & "',"
SQL = SQL & "课程名称='" & Trim(txtlesson.Text) & "',"
SQL = SQL & "授课老师='" & Trim(cobteacher.Text) & "',"
SQL = SQL & "学分='" & Trim(txtmark.Text) & "',"
SQL = SQL & "课时='" & Trim(txttime.Text) & "',"
SQL = SQL & "对象班级='" & Trim(cobclass.Text) & "'"
SQL = SQL & " Where 课程编号='" & Trim(tnumber) & "'"
adoCon.Execute (SQL)

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

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




Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Command2_Click()
  fillRecord1

End Sub

Private Sub Form_Load()
txtmark.Text = UpDown2.Value
txttime.Text = UpDown1.Value
ShockwaveFlash1.Movie = App.Path & "\flash\top.swf"

Me.Height = 3555
Me.Width = 5070
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
 FillControl1
    
    fillRecord1
End Sub
Private Sub FillControl1()
txtnumber.Text = ""
txtmark.Text = ""
txttime.Text = ""
'班级
Set adoRS = adoCon.Execute("Select Name From Class Order By Name")
cobclass.Clear
Do While Not adoRS.EOF
  cobclass.AddItem Trim(adoRS("Name"))
  adoRS.MoveNext
Loop
cobclass.ListIndex = 0

'教师
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

End Sub
Private Sub fillRecord1()
'数据添加到控件中
 
 Dim SQL As String
 
 SQL = "select * from Lesson where 课程编号='" & frmupdatelesson.sID1 & "'"
 Set adoRS = adoCon.Execute(SQL)
 txtnumber.Text = Trim(adoRS("课程编号"))
 tnumber = Trim(adoRS("课程编号"))
 txtlesson.Text = Trim(adoRS("课程名称"))
 cobteacher.Text = Trim(adoRS("授课老师"))
 txtmark.Text = Trim(adoRS("学分"))
 txttime.Text = Trim(adoRS("课时"))
 cobclass.Text = Trim(adoRS("对象班级"))
 
 Set adoRS = Nothing
 
 
 

End Sub

Private Sub next_Click()
Unload Me
frmupdatelesson.Show
End Sub

Private Sub UpDown1_Change()
txttime.Text = UpDown1.Value

End Sub

Private Sub UpDown2_Change()
txtmark.Text = UpDown2.Value

End Sub

⌨️ 快捷键说明

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