📄 delbook.frm
字号:
VERSION 5.00
Begin VB.Form delbook
Caption = "删除图书"
ClientHeight = 4605
ClientLeft = 60
ClientTop = 450
ClientWidth = 6585
LinkTopic = "delbook"
ScaleHeight = 4605
ScaleWidth = 6585
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture2
BorderStyle = 0 'None
Height = 1470
Index = 0
Left = 105
ScaleHeight = 1470
ScaleWidth = 6375
TabIndex = 20
Top = 3045
Width = 6375
Begin VB.CommandButton Command4
BackColor = &H8000000D&
Caption = "确定"
Height = 645
Left = 1470
Style = 1 'Graphical
TabIndex = 23
Top = 840
Width = 960
End
Begin VB.CommandButton Command1
BackColor = &H8000000D&
Caption = "取消"
Height = 645
Left = 3885
Style = 1 'Graphical
TabIndex = 22
Top = 840
Width = 960
End
Begin VB.Label labFlag
AutoSize = -1 'True
Caption = "确实要删除当前记录吗?"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 2040
TabIndex = 21
Top = 240
Width = 2640
End
End
Begin VB.PictureBox Picture2
BorderStyle = 0 'None
Height = 1575
Index = 1
Left = 0
ScaleHeight = 1575
ScaleWidth = 6375
TabIndex = 16
Top = 3120
Width = 6375
Begin VB.CommandButton Command2
BackColor = &H8000000D&
Caption = "确定"
Height = 645
Left = 1575
Style = 1 'Graphical
TabIndex = 18
Top = 735
Width = 960
End
Begin VB.CommandButton Command3
BackColor = &H8000000D&
Caption = "取消"
Height = 645
Left = 3885
Style = 1 'Graphical
TabIndex = 17
Top = 735
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "确实要修改当前记录吗?"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 2040
TabIndex = 19
Top = 240
Width = 2640
End
End
Begin VB.Frame Frame1
Caption = "图书基本信息"
Height = 2895
Index = 2
Left = 105
TabIndex = 0
Top = 105
Width = 6375
Begin VB.TextBox Text2
Height = 330
Left = 1470
TabIndex = 8
Text = "Text2"
Top = 1215
Width = 1275
End
Begin VB.TextBox Text1
Height = 315
Left = 2310
TabIndex = 7
Text = "Text1"
Top = 525
Width = 1590
End
Begin VB.TextBox Text3
Height = 330
Left = 1470
TabIndex = 6
Text = "Text3"
Top = 1845
Width = 1275
End
Begin VB.TextBox Text4
Height = 330
Left = 1470
TabIndex = 5
Text = "Text4"
Top = 2370
Width = 1275
End
Begin VB.TextBox Text5
Height = 330
Left = 4725
TabIndex = 4
Text = "Text5"
Top = 1215
Width = 1275
End
Begin VB.TextBox Text6
Height = 330
Left = 4725
TabIndex = 3
Text = "Text6"
Top = 1845
Width = 1275
End
Begin VB.TextBox Text7
Height = 330
Left = 4725
TabIndex = 2
Text = "Text7"
Top = 2370
Width = 1275
End
Begin VB.CommandButton Command5
Caption = "搜索"
Height = 330
Left = 4410
TabIndex = 1
Top = 525
Width = 750
End
Begin VB.Line Line1
X1 = 105
X2 = 6195
Y1 = 1050
Y2 = 1050
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "图书编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 240
Index = 10
Left = 1155
TabIndex = 15
Top = 600
Width = 1020
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "价 格"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 12
Left = 420
TabIndex = 14
Top = 2415
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "类 别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 13
Left = 420
TabIndex = 13
Top = 1890
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "出 版 社"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 14
Left = 3465
TabIndex = 12
Top = 1890
Width = 1035
End
Begin VB.Image Image1
Height = 480
Index = 2
Left = 600
Picture = "delbook.frx":0000
Top = 480
Width = 480
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "书 名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 0
Left = 420
TabIndex = 11
Top = 1260
Width = 780
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "图书状态"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 1
Left = 3465
TabIndex = 10
Top = 1260
Width = 1020
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "入库时间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 2
Left = 3465
TabIndex = 9
Top = 2415
Width = 1020
End
Begin VB.Line Line2
X1 = 3150
X2 = 3150
Y1 = 1155
Y2 = 2835
End
Begin VB.Image Image2
Height = 480
Index = 0
Left = 5880
Picture = "delbook.frx":0442
Top = 105
Width = 480
End
End
End
Attribute VB_Name = "delbook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
On Error GoTo no
Call upD2
rst.Update
rst.MoveNext
If rst.EOF Or rst.BOF Then
rst.Move First
End If
Exit Sub
no:
MsgBox "修改成功"
End Sub
Private Sub Command4_Click()
If rst.EOF = True And rst.BOF = True Then
MsgBox "没有数据!"
Else
rst.Delete
rst.MoveFirst
If rst.BOF Or rst.EOF Then
MsgBox "没有数据"
Call txtCls
End If
Call showDB
End If
End Sub
Private Sub Command5_Click()
Dim strF As String
strF = "select * from book where bookid like '%" & Text1.Text & "%'"
If QueryData(strF) Then
Text2.Text = rst.Fields("bookname").Value
Text3.Text = rst.Fields("booktype").Value
Text4.Text = rst.Fields("bookprice").Value
Text5.Text = rst.Fields("bookstate").Value
Text6.Text = rst.Fields("bookpublish").Value
Text7.Text = rst.Fields("bookintime").Value
End If
End Sub
Private Sub Form_Load()
Call txtCls
End Sub
Private Sub upD2()
rst.Fields(0).Value = Text1.Text
rst.Fields(1).Value = Text2.Text
rst.Fields(2).Value = Text3.Text
rst.Fields(3).Value = Text4.Text
rst.Fields(4).Value = Text5.Text
rst.Fields(5).Value = Text6.Text
rst.Fields(6).Value = Text7.Text
End Sub
Private Sub txtCls()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub showDB()
Text1.Text = rst.Fields(0).Value
Text2.Text = rst.Fields(1).Value
Text3.Text = rst.Fields(2).Value
Text4.Text = rst.Fields(3).Value
Text5.Text = rst.Fields(4).Value
Text6.Text = rst.Fields(5).Value
Text7.Text = rst.Fields(6).Value
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -