📄 updatebook.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form updatebook
BackColor = &H80000000&
Caption = "图书管理"
ClientHeight = 8370
ClientLeft = 60
ClientTop = 345
ClientWidth = 11100
FillColor = &H00FFC0C0&
ForeColor = &H00FF0000&
LinkTopic = "Form1"
MaxButton = 0 'False
Moveable = 0 'False
ScaleHeight = 8370
ScaleWidth = 11100
StartUpPosition = 1 '所有者中心
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 495
Left = 0
TabIndex = 3
Top = 7875
Width = 11100
_ExtentX = 19579
_ExtentY = 873
SimpleText = "设计者:雷云军 "
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Height = 4995
Left = 120
TabIndex = 0
Top = 600
Width = 10815
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "updatebook.frx":0000
Height = 4695
Left = 240
TabIndex = 1
Top = 240
Width = 10335
_ExtentX = 18230
_ExtentY = 8281
_Version = 393216
AllowUpdate = -1 'True
AllowArrows = -1 'True
BackColor = 14737632
DefColWidth = 87
ForeColor = 4194368
HeadLines = 1
RowHeight = 15
RowDividerStyle = 4
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
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 = 2
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
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 5280
Top = -120
Visible = 0 'False
Width = 1920
_ExtentX = 3387
_ExtentY = 582
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.4.0;Data Source=db2.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db2.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "book"
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
End
Begin MSComctlLib.Toolbar Toolbar1
Height = 585
Left = 2040
TabIndex = 2
Top = 0
Width = 6615
_ExtentX = 11668
_ExtentY = 1032
ButtonWidth = 1455
ButtonHeight = 926
Appearance = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 8
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "增加图书"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除图书"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "最前一条"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "下一条"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "上一条"
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "最后一条"
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保 存"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退 出"
EndProperty
EndProperty
End
End
Attribute VB_Name = "updatebook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Adodc1.Recordset.Delete
Adodc1.Refresh
End Sub
Private Sub Command3_Click()
Adodc1.Recordset.UpdateBatch
Adodc1.Refresh
DataGrid1.Refresh
MsgBox "增加成功"
Command1.Enabled = True
DataGrid1.AllowAddNew = False
Command3.Enabled = False
End Sub
Private Sub Command4_Click()
Unload updatebook
End Sub
Private Sub Command5_Click()
End Sub
Private Sub Command6_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MovePrevious
MsgBox "已经是最后一条"
End If
End Sub
Private Sub Command8_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveNext
MsgBox "已经是最前一条"
End If
End Sub
Private Sub Command9_Click()
useradodc.Recordset.MoveLast
End Sub
Private Sub Form_Load()
Toolbar1.Buttons(7).Enabled = False
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
addbook.Show
Case 2
Adodc1.Recordset.Delete
Adodc1.Refresh
Case 3
Adodc1.Recordset.MoveFirst
Case 4
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MovePrevious
MsgBox "已经是最后一条"
End If
Case 5
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveNext
MsgBox "已经是最前一条"
End If
Case 6
Adodc1.Recordset.MoveLast
Case 7
Adodc1.Recordset.UpdateBatch
Adodc1.Refresh
updatebook.Refresh
DataGrid1.Refresh
MsgBox "增加成功"
Toolbar1.Buttons(1).Enabled = True
DataGrid1.AllowAddNew = False
Toolbar1.Buttons(7).Enabled = False
Case 8
Unload updatebook
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -