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

📄 form0706.frm

📁 VB实验教程源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "输入学生成绩"
   ClientHeight    =   3450
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4950
   LinkTopic       =   "Form1"
   ScaleHeight     =   3450
   ScaleWidth      =   4950
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "前一个"
      Height          =   495
      Index           =   1
      Left            =   3480
      TabIndex        =   13
      Top             =   1080
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "下一个"
      Height          =   495
      Index           =   2
      Left            =   3480
      TabIndex        =   12
      Top             =   1800
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "最后一个"
      Height          =   495
      Index           =   3
      Left            =   3480
      TabIndex        =   11
      Top             =   2520
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "第一个"
      Height          =   495
      Index           =   0
      Left            =   3480
      TabIndex        =   10
      Top             =   360
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      DataField       =   "学号"
      DataSource      =   "Adodc1"
      Height          =   495
      Index           =   0
      Left            =   1680
      TabIndex        =   4
      Top             =   240
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      DataField       =   "姓名"
      DataSource      =   "Adodc1"
      Height          =   495
      Index           =   1
      Left            =   1680
      TabIndex        =   3
      Top             =   840
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      DataField       =   "语文"
      DataSource      =   "Adodc1"
      Height          =   495
      Index           =   2
      Left            =   1680
      TabIndex        =   2
      Top             =   1440
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      DataField       =   "数学"
      DataSource      =   "Adodc1"
      Height          =   495
      Index           =   3
      Left            =   1680
      TabIndex        =   1
      Top             =   2040
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      DataField       =   "英语"
      DataSource      =   "Adodc1"
      Height          =   495
      Index           =   4
      Left            =   1680
      TabIndex        =   0
      Top             =   2640
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "姓名"
      Height          =   375
      Left            =   480
      TabIndex        =   9
      Top             =   960
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "语文"
      Height          =   255
      Left            =   480
      TabIndex        =   8
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "数学"
      Height          =   255
      Left            =   480
      TabIndex        =   7
      Top             =   2160
      Width           =   1095
   End
   Begin VB.Label Label4 
      Caption         =   "英语"
      Height          =   375
      Left            =   480
      TabIndex        =   6
      Top             =   2640
      Width           =   1095
   End
   Begin VB.Label Label5 
      Caption         =   "学号"
      Height          =   495
      Left            =   480
      TabIndex        =   5
      Top             =   360
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnnStudent As ADODB.Connection
Dim rsScore As Recordset

Private Sub Command1_Click(Index As Integer)
'单击移动按钮控件数组
    Dim i As Integer
    With rsScore
        Select Case Index
            Case 0
                .MoveFirst
            Case 1
                .MovePrevious
                If .BOF Then .MoveFirst
            Case 2
                .MoveNext
                If .EOF Then .MoveLast
            Case 3
                .MoveLast
            End Select
            For i = 0 To 4
                Text1(i).Text = .Fields(i)
            Next i
    End With
End Sub

Private Sub Form_Load()
'装载窗体
    Dim i As Integer
    Set cnnStudent = New Connection
    Set rsScore = New Recordset
    cnnStudent.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source =C:\Documents and Settings\CAO Yi\My Documents\BookVBQH\BookVBQH\exe\StudentAd.mdb"
    cnnStudent.Open
    rsScore.Open "score", cnnStudent, adOpenKeyset, adLockOptimistic
    rsScore.MoveFirst
    '在文本框中显示字段
    For i = 0 To 4
        Text1(i).Text = rsScore.Fields(i)
    Next i
End Sub

⌨️ 快捷键说明

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