📄 v6bj11-03.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "VB6 例11-03 用按钮控制记录浏览"
ClientHeight = 1365
ClientLeft = 60
ClientTop = 345
ClientWidth = 4800
LinkTopic = "Form1"
ScaleHeight = 1365
ScaleWidth = 4800
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
DataField = "学号"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 9
Top = 60
Width = 855
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Data1"
Height = 375
Left = 2640
TabIndex = 8
Top = 60
Width = 1215
End
Begin VB.TextBox Text4
DataField = "专业"
DataSource = "Data1"
Height = 375
Left = 1320
TabIndex = 7
Top = 540
Width = 1335
End
Begin VB.TextBox Text5
DataField = "出生年月"
DataSource = "Data1"
Height = 375
Left = 3540
TabIndex = 6
Top = 540
Width = 1215
End
Begin VB.TextBox Text3
DataField = "性别"
DataSource = "Data1"
Height = 375
Left = 4320
TabIndex = 5
Top = 60
Width = 375
End
Begin VB.PictureBox Picture1
AutoSize = -1 'True
DataField = "照片"
DataSource = "Data1"
Height = 855
Left = 60
ScaleHeight = 795
ScaleWidth = 675
TabIndex = 4
Top = 60
Width = 735
End
Begin VB.CommandButton Command4
Caption = "末记录"
Height = 315
Left = 3540
TabIndex = 3
Top = 1020
Width = 855
End
Begin VB.CommandButton Command3
Caption = "下一条"
Height = 315
Left = 2460
TabIndex = 2
Top = 1020
Width = 855
End
Begin VB.CommandButton Command2
Caption = "上一条"
Height = 315
Left = 1380
TabIndex = 1
Top = 1020
Width = 855
End
Begin VB.CommandButton Command1
Caption = "首记录"
Height = 315
Left = 300
TabIndex = 0
Top = 1020
Width = 855
End
Begin VB.Data Data1
Align = 2 'Align Bottom
Caption = "基本情况"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "基本情况"
Top = 1020
Visible = 0 'False
Width = 4800
End
Begin VB.Label Label1
Caption = "姓名"
Height = 255
Index = 1
Left = 2220
TabIndex = 14
Top = 180
Width = 495
End
Begin VB.Label Label1
Caption = "专业"
Height = 255
Index = 2
Left = 840
TabIndex = 13
Top = 660
Width = 495
End
Begin VB.Label Label1
Caption = "年龄"
Height = 255
Index = 3
Left = 2940
TabIndex = 12
Top = 600
Width = 495
End
Begin VB.Label Label1
Caption = "性别"
Height = 255
Index = 4
Left = 3930
TabIndex = 11
Top = 180
Width = 405
End
Begin VB.Label Label1
Caption = "学号"
Height = 255
Index = 0
Left = 840
TabIndex = 10
Top = 180
Width = 495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
End Sub
Private Sub Command2_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
MsgBox "第一条记录"
Data1.Recordset.MoveFirst
End If
End Sub
Private Sub Command3_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
MsgBox "最后一条记录"
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Command4_Click()
Data1.Recordset.MoveLast
End Sub
Private Sub Form_Load()
mpath = App.Path
If Right(mpath, 1) <> "\" Then mpath = mpath + "\"
Data1.DatabaseName = mpath + "student.mdb"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -