📄 form3.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form3
Caption = "Form3"
ClientHeight = 5985
ClientLeft = 60
ClientTop = 345
ClientWidth = 8145
LinkTopic = "Form3"
ScaleHeight = 5985
ScaleWidth = 8145
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame2
Height = 1455
Left = 120
TabIndex = 13
Top = 4440
Width = 7935
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 360
TabIndex = 21
Top = 240
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 495
Left = 2280
TabIndex = 20
Top = 240
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "更新"
Height = 495
Left = 4080
TabIndex = 19
Top = 240
Width = 1215
End
Begin VB.CommandButton Command5
Caption = "第一条"
Height = 495
Left = 360
TabIndex = 18
Top = 840
Width = 1335
End
Begin VB.CommandButton Command6
Caption = "前一条"
Height = 495
Left = 2280
TabIndex = 17
Top = 840
Width = 1215
End
Begin VB.CommandButton Command7
Caption = "下一条"
Height = 495
Left = 4080
TabIndex = 16
Top = 840
Width = 1215
End
Begin VB.CommandButton Command8
Caption = "末一条"
Height = 495
Left = 6000
TabIndex = 15
Top = 840
Width = 1335
End
Begin VB.CommandButton Command9
Caption = "退出"
Height = 495
Left = 6000
TabIndex = 14
Top = 240
Width = 1335
End
End
Begin VB.Frame Frame1
Caption = "寝室人员基本情况表"
Height = 1935
Left = 120
TabIndex = 2
Top = 120
Width = 7935
Begin VB.TextBox Text1
DataField = "学号"
DataSource = "Adodc1"
Height = 375
Left = 3600
TabIndex = 7
Top = 600
Width = 1575
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Adodc1"
Height = 375
Left = 1080
TabIndex = 6
Top = 600
Width = 1575
End
Begin VB.TextBox Text3
DataField = "班级"
DataSource = "Adodc1"
Height = 375
Left = 1080
TabIndex = 5
Top = 1320
Width = 1575
End
Begin VB.TextBox Text4
DataField = "寝室号"
DataSource = "Adodc1"
Height = 375
Left = 3600
TabIndex = 4
Top = 1320
Width = 1695
End
Begin VB.TextBox Text5
DataField = "床位"
DataSource = "Adodc1"
Height = 375
Left = 5880
TabIndex = 3
Top = 1320
Width = 1575
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "学号"
Height = 180
Left = 3120
TabIndex = 12
Top = 600
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓名"
Height = 180
Left = 600
TabIndex = 11
Top = 600
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "班级"
Height = 180
Left = 600
TabIndex = 10
Top = 1320
Width = 360
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "寝室号"
Height = 180
Left = 2880
TabIndex = 9
Top = 1320
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "床位号"
Height = 180
Left = 6360
TabIndex = 8
Top = 600
Width = 540
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form3.frx":0000
Height = 2175
Left = 120
TabIndex = 1
Top = 2160
Width = 7935
_ExtentX = 13996
_ExtentY = 3836
_Version = 393216
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 5
BeginProperty Column00
DataField = "学号"
Caption = "学号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "姓名"
Caption = "姓名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "班级"
Caption = "班级"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "寝室号"
Caption = "寝室号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "床位"
Caption = "床位"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 734.74
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
BeginProperty Column03
ColumnWidth = 734.74
EndProperty
BeginProperty Column04
ColumnWidth = 734.74
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 5160
Top = 1680
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\xrh\disk1\DOWNLOAD\vb\程序代码\公寓管理\Mydb.mdb"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\xrh\disk1\DOWNLOAD\vb\程序代码\公寓管理\Mydb.mdb"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "student"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 495
Left = 4020
TabIndex = 0
Top = 120
Width = 270
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo adderr
Text1.SetFocus
Adodc1.Recordset.AddNew
Exit Sub
adderr:
MsgBox Err.Description
End Sub
Private Sub Command2_Click()
On Error GoTo deleteerr
With Adodc1.Recordset
If Not .EOF And Not .BOF Then
If MsgBox("删除当前记录吗?", vbYesNo + vbQuestion) = vbYes Then
.Delete
.MoveNext
If .EOF Then .MoveLast
End If
End If
End With
Exit Sub
deleteerr:
MsgBox Err.Description
End Sub
Private Sub Command3_Click()
On Error GoTo updateerr
Adodc1.Recordset.UpdateBatch
Exit Sub
updateerr:
MsgBox Err.Description
End Sub
Private Sub Command4_Click()
On Error GoTo cancelupdateerr
Adodc1.Recordset.CancelBatch
Exit Sub
cancelupdateerr:
MsgBox Err.Description
End Sub
Private Sub Command5_Click()
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "记录空", vbOKCancel + vbQuestion
End
Else
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command6_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
MsgBox "这是第一条记录", vbOKCancel + vbQuestion
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
MsgBox "这是最后一条记录", vbOKCancel + vbQuestion
Adodc1.Recordset.MoveLast
End Sub
Private Sub Command8_Click()
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "空记录", vbOKCancel + vbQuestion
End
Else
Adodc1.Recordset.MoveLast
End If
End Sub
Private Sub Command9_Click()
caidan.Show
Form3.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -