📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form tianjiatushuleibie
Caption = "添加图书类别"
ClientHeight = 5085
ClientLeft = 60
ClientTop = 345
ClientWidth = 5865
Icon = "Form1.frx":0000
LinkTopic = "Form1"
Picture = "Form1.frx":1E72
ScaleHeight = 5085
ScaleWidth = 5865
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Height = 375
Left = 2880
TabIndex = 12
Top = 1320
Width = 1455
End
Begin VB.CommandButton Command7
Caption = "清空数据 "
Height = 495
Left = 4080
TabIndex = 10
Top = 2280
Width = 1095
End
Begin VB.CommandButton Command6
Caption = "图书信息管理"
Height = 495
Left = 3480
TabIndex = 9
Top = 3960
Width = 1455
End
Begin VB.CommandButton Command5
Caption = "查询图书信息"
Height = 495
Left = 1440
TabIndex = 8
Top = 3960
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "添加图书信息"
Height = 495
Left = 3480
TabIndex = 7
Top = 3240
Width = 1455
End
Begin VB.CommandButton Command3
Caption = "图书类别管理"
Height = 495
Left = 1440
TabIndex = 6
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "关闭窗口"
Height = 495
Left = 2760
TabIndex = 5
Top = 2280
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1440
TabIndex = 4
Top = 2280
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 2880
TabIndex = 1
Top = 840
Width = 1455
End
Begin VB.TextBox Text1
ForeColor = &H00000000&
Height = 375
Left = 2880
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.Label Label3
Caption = "关键字 "
Height = 375
Left = 1800
TabIndex = 11
Top = 1440
Width = 1095
End
Begin VB.Label Label2
Caption = "图书编号"
Height = 495
Left = 1800
TabIndex = 3
Top = 360
Width = 1335
End
Begin VB.Label Label1
Caption = "图书类别"
Height = 495
Left = 1800
MouseIcon = "Form1.frx":7324
TabIndex = 2
Top = 960
Width = 1215
End
End
Attribute VB_Name = "tianjiatushuleibie"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
tushuleibieguanli.Show
End Sub
Private Sub Command4_Click()
tianjiatushuxinxi.Show
End Sub
Private Sub Command5_Click()
chaxuntushu.Show
End Sub
Private Sub Command6_Click()
tushuxinxiguanli.Show
End Sub
Private Sub Command7_Click()
Text1.Text = Empty
Text2.Text = Empty
Text3.Text = Empty
End Sub
Private Sub Form_Load()
'conn.Open "provider=microsoft.jet.oledb.4.0;" & "data source=" & App.Path & "\db1.mdb"
End Sub
Private Sub Command1_Click()
Dim rs_bookstyle As New adodb.Recordset
Dim sql As String
If Trim(Text1.Text) = "" Then
MsgBox "图书编号不能为空", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "种类类别不能为空", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "查询关键字不能为空", vbOKOnly + vbExclamation, ""
Text3.SetFocus
Exit Sub
End If
sql = "select * from bookstypes where typename='" & Text1.Text & "'"
rs_bookstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_bookstyle.EOF Then
rs_bookstyle.AddNew
rs_bookstyle.Fields(0) = Trim(Text1.Text)
rs_bookstyle.Fields(1) = Trim(Text2.Text)
rs_bookstyle.Fields(2) = Trim(Text3.Text)
rs_bookstyle.Update
MsgBox "添加图书类别成功!", vbOKOnly, ""
rs_bookstyle.Close
Else
MsgBox "图书类别或者图书编号重复!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
rs_bookstyle.Close
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -