📄 添加图书.frm
字号:
VERSION 5.00
Begin VB.Form 添加图书
Caption = "添加图书"
ClientHeight = 3495
ClientLeft = 60
ClientTop = 450
ClientWidth = 5775
LinkTopic = "Form1"
ScaleHeight = 3495
ScaleWidth = 5775
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Caption = "返回"
Height = 375
Left = 4200
TabIndex = 11
Top = 2520
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 4200
TabIndex = 10
Top = 1440
Width = 975
End
Begin VB.TextBox Text5
Height = 285
Left = 2160
TabIndex = 9
Text = "1999"
Top = 2200
Width = 1095
End
Begin VB.TextBox Text4
Height = 285
Left = 2160
TabIndex = 7
Text = "武侠"
Top = 1720
Width = 1095
End
Begin VB.TextBox Text3
Height = 285
Left = 2160
TabIndex = 6
Text = "沧月"
Top = 1240
Width = 1095
End
Begin VB.TextBox Text2
Height = 285
Left = 2160
TabIndex = 5
Text = "曼珠沙华"
Top = 760
Width = 1095
End
Begin VB.TextBox Text1
Height = 285
Left = 2160
TabIndex = 4
Text = "05433"
Top = 280
Width = 1095
End
Begin VB.Label Label5
Caption = "出版时间:"
Height = 255
Left = 600
TabIndex = 8
Top = 2280
Width = 1215
End
Begin VB.Label Label4
Caption = "出版社:"
Height = 255
Left = 600
TabIndex = 3
Top = 1800
Width = 1215
End
Begin VB.Label Label3
Caption = "作者:"
Height = 255
Left = 600
TabIndex = 2
Top = 1320
Width = 1215
End
Begin VB.Label Label2
Caption = "书名:"
Height = 255
Left = 600
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.Label Label1
Caption = "图书编号:"
Height = 255
Left = 600
TabIndex = 0
Top = 360
Width = 1215
End
End
Attribute VB_Name = "添加图书"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Error_num As Integer
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then
MsgBox "数据输入不完整,请完成输入!", vbOKOnly, "输入错误!"
Exit Sub
End If
Mycom.ActiveConnection = Mycon
Mycom.CommandType = adCmdStoredProc
Mycom.CommandText = "添加图书"
Mycom.Parameters(1) = 0
Mycom.Parameters(2) = Text1.Text
Mycom.Parameters(3) = Text2.Text
Mycom.Parameters(4) = Text3.Text
Mycom.Parameters(5) = Text4.Text
Mycom.Parameters(6) = Text5.Text
Mycom.Execute
Error_num = Mycom.Parameters(1)
If Error_num = 2 Then
MsgBox "该图书编号已存在!请重新输入!"
Text1.Text = ""
Else
MsgBox "该图书信息已成功添加到“图书信息”表中!", vbOKOnly, "添加成功!"
End If
Set Mycom = Nothing
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -