📄 frmbookrecord.frm
字号:
Begin VB.Label Label3
Caption = "出 版 社:"
Height = 255
Left = 600
TabIndex = 7
Top = 1080
Width = 855
End
Begin VB.Label Label2
Caption = "书 名:"
Height = 255
Left = 600
TabIndex = 5
Top = 720
Width = 855
End
Begin VB.Label Label1
Caption = "书 号:"
Height = 255
Left = 600
TabIndex = 3
Top = 360
Width = 855
End
End
Begin MSDataGridLib.DataGrid dgbookrecord
Bindings = "frmBookRecord.frx":0000
Height = 3495
Left = -240
TabIndex = 0
Top = 3240
Width = 11415
_ExtentX = 20135
_ExtentY = 6165
_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 = 7
BeginProperty Column00
DataField = "BookNo"
Caption = "BookNo"
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 = "BookName"
Caption = "BookName"
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 = "Publisher"
Caption = "Publisher"
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 = "Author"
Caption = "Author"
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 = "SalesPrice"
Caption = "SalesPrice"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column05
DataField = "Quantity"
Caption = "Quantity"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column06
DataField = "Discount"
Caption = "Discount"
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 = 2085.166
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
BeginProperty Column03
ColumnWidth = 2085.166
EndProperty
BeginProperty Column04
ColumnWidth = 2085.166
EndProperty
BeginProperty Column05
ColumnWidth = 1094.74
EndProperty
BeginProperty Column06
ColumnWidth = 2085.166
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmBookRecord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdadd_Click()
On Error GoTo handle '避免连续点击而出现错误,使程序中断.
AdoBookRecord.Recordset.AddNew
Exit Sub
handle:
End Sub
Private Sub cmdcancel_Click()
AdoBookRecord.Recordset.CancelBatch
End Sub
Private Sub cmddel_Click()
Dim a As Integer
If AdoBookRecord.Recordset.EOF = True Then Exit Sub '没有记录则跳开
a = MsgBox("确认要删除当前记录?", 36)
If a = 6 Then
AdoBookRecord.Recordset.Delete
End If
End Sub
Private Sub cmdend_Click()
Unload Me
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdfind_Click()
frmFind.Show
End Sub
Private Sub cmdfirst_Click()
If AdoBookRecord.Recordset.EOF = True Then Exit Sub '没有记录则跳开
AdoBookRecord.Recordset.MoveFirst
End Sub
Private Sub cmdlast_Click()
If AdoBookRecord.Recordset.EOF = True Then Exit Sub '没有记录则跳开
AdoBookRecord.Recordset.MoveLast
End Sub
Private Sub cmdnext_Click()
If AdoBookRecord.Recordset.EOF = True Then Exit Sub '没有记录则跳开
If AdoBookRecord.Recordset.AbsolutePosition _
<> AdoBookRecord.Recordset.RecordCount Then '如果当前记录不是最后一条
AdoBookRecord.Recordset.MoveNext '记录指针移到下一条
Else
MsgBox "已经到达最后一条记录!"
End If
End Sub
Private Sub cmdpre_Click()
If AdoBookRecord.Recordset.EOF = True Then Exit Sub '没有记录则跳开
If AdoBookRecord.Recordset.AbsolutePosition <> 1 Then '如果当前记录不是第一条
AdoBookRecord.Recordset.MovePrevious ' 记录指针移到上一条
Else
MsgBox "已经到达第一条记录"
End If
End Sub
Private Sub cmdrefresh_Click()
On Error GoTo handle
AdoBookRecord.Recordset.Update
AdoBookRecord.RecordSource = "select * from bookrecord"
AdoBookRecord.Refresh
Exit Sub
handle:
MsgBox Err.Description '描述错误原因
AdoBookRecord.Recordset.CancelBatch
End Sub
Private Sub cmdsave_Click()
On Error GoTo handle '发生错误则跳到handle
AdoBookRecord.Recordset.Update
Exit Sub
handle:
MsgBox Err.Description '描述错误原因
AdoBookRecord.Recordset.CancelBatch
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -