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

📄 form9.frm

📁 用VB编的学生信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form9 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "学生成绩修改"
   ClientHeight    =   2550
   ClientLeft      =   45
   ClientTop       =   390
   ClientWidth     =   5535
   LinkTopic       =   "Form9"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   2550
   ScaleWidth      =   5535
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   3360
      TabIndex        =   8
      Top             =   240
      Width           =   1095
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      Left            =   840
      TabIndex        =   7
      Top             =   720
      Width           =   1695
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   840
      TabIndex        =   6
      Top             =   240
      Width           =   1695
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      Height          =   375
      Left            =   3480
      TabIndex        =   2
      Top             =   1680
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "保存"
      Height          =   375
      Left            =   1800
      TabIndex        =   1
      Top             =   1680
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改"
      Height          =   375
      Left            =   480
      TabIndex        =   0
      Top             =   1680
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "课程:"
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   720
      Width           =   615
   End
   Begin VB.Label Label4 
      Caption         =   "成绩:"
      Height          =   255
      Left            =   2640
      TabIndex        =   4
      Top             =   240
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "学号:"
      Height          =   255
      Left            =   240
      TabIndex        =   3
      Top             =   240
      Width           =   495
   End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim mrc As New ADODB.Recordset

Private Sub Command1_Click()
  Dim con As New ADODB.Connection
  Dim mr As New ADODB.Recordset
  Dim txtsql As String
   txtsql = "select 学生基本信息表.学号 from 学生基本信息表  "
  Set mr = executesql(txtsql)
  Do While Not mr.EOF
   Combo2.Text = "VB"
   Combo1.AddItem mr.Fields(0).Value
   mr.MoveNext
  Loop
   txtsql = "select 课程表.课程 from 课程表 "
  Set mr = executesql(txtsql)
  Do While Not mr.EOF
   Combo2.AddItem mr.Fields(0).Value
   Combo1.Text = "20060301"
  mr.MoveNext
  Loop
End Sub

Private Sub Command2_Click()
  Dim txtsql As String
  txtsql = "select * from 成绩表 where "
    txtsql = txtsql & "课程=" & "'" & Combo2.Text & "'"
  Set mrc = executesql(txtsql)
   mrc.Fields(2).Value = Text1.Text
    mrc.Update
End Sub
Public Function executesql(ByVal sql As String) As ADODB.Recordset
  Dim cnn As ADODB.Connection
  Dim rst As ADODB.Recordset
  Set cnn = New ADODB.Connection
  Dim stokens() As String
   stokens = Split(sql)
   cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\student.mdb"
  If InStr(" INSERT,DELETE,UPDATE", UCase$(stokens(0))) Then
   cnn.Execute sql
  Else
  Set rst = New ADODB.Recordset
   rst.Open Trim$(sql), cnn, adOpenKeyset, adLockOptimistic
  Set executesql = rst
  End If
End Function

Private Sub Command3_Click()
 Me.Hide
End Sub

Private Sub Form_Load()
  connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\student.mdb"
  conn.Open connstr
End Sub


⌨️ 快捷键说明

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