📄 主窗体.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "图书管理系统"
ClientHeight = 5160
ClientLeft = 60
ClientTop = 450
ClientWidth = 10635
Icon = "主窗体.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5160
ScaleWidth = 10635
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
DataField = "图书号"
DataSource = "Adodc1"
Height = 615
Left = 1080
Locked = -1 'True
TabIndex = 16
Top = 2040
Width = 975
End
Begin VB.CommandButton Command5
Caption = "新书添加"
Enabled = 0 'False
Height = 615
Left = 7920
TabIndex = 15
Top = 3960
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "还书"
Height = 615
Left = 6600
TabIndex = 14
Top = 3960
Width = 975
End
Begin VB.CommandButton Command3
Caption = "借书"
Height = 615
Left = 5280
TabIndex = 13
Top = 3960
Width = 975
End
Begin VB.CommandButton command2
Caption = "结束"
Height = 615
Left = 9360
TabIndex = 12
Top = 3960
Width = 975
End
Begin VB.CommandButton Command1
Caption = "查找"
Height = 615
Left = 3840
TabIndex = 11
Top = 3960
Width = 1095
End
Begin VB.TextBox Text6
DataField = "备注"
DataSource = "Adodc1"
Height = 615
Left = 8520
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 10
Top = 2040
Width = 975
End
Begin VB.TextBox Text5
DataField = "读者号"
DataSource = "Adodc1"
Height = 615
Left = 7080
Locked = -1 'True
TabIndex = 9
Top = 2040
Width = 975
End
Begin VB.TextBox Text4
DataField = "存入时间"
DataSource = "Adodc1"
Height = 615
Left = 5640
Locked = -1 'True
TabIndex = 8
Top = 2040
Width = 975
End
Begin VB.TextBox Text3
DataField = "作者"
DataSource = "Adodc1"
Height = 615
Left = 4200
Locked = -1 'True
TabIndex = 7
Top = 2040
Width = 975
End
Begin VB.TextBox Text2
DataField = "书名"
DataSource = "Adodc1"
Height = 615
Left = 2520
Locked = -1 'True
TabIndex = 6
Top = 2040
Width = 975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 600
Top = 3840
Width = 3015
_ExtentX = 5318
_ExtentY = 1296
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 = $"主窗体.frx":0A02
OLEDBString = $"主窗体.frx":0A8E
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "tsxx"
Caption = " 浏览图书记录"
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
Begin VB.Label Label6
Caption = "备注"
Height = 495
Left = 8640
TabIndex = 5
Top = 1200
Width = 975
End
Begin VB.Label Label5
Caption = "读者号"
Height = 375
Left = 7200
TabIndex = 4
Top = 1200
Width = 735
End
Begin VB.Label Label4
Caption = "存入时间"
Height = 375
Left = 5880
TabIndex = 3
Top = 1260
Width = 735
End
Begin VB.Label Label3
Caption = "作者"
Height = 375
Left = 4440
TabIndex = 2
Top = 1230
Width = 735
End
Begin VB.Label Label2
Caption = "书名"
Height = 375
Left = 2760
TabIndex = 1
Top = 1290
Width = 735
End
Begin VB.Label Label1
Caption = "图书号"
Height = 375
Left = 1200
TabIndex = 0
Top = 1320
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim temp As String
Dim a As Integer
'查找
Private Sub Command1_Click()
a = Adodc1.Recordset.AbsolutePosition
Adodc1.CommandType = adCmdUnknown
temp = InputBox("请输入图书名称", "提示信息")
Adodc1.RecordSource = "Select * From tsxx Where 书名 ='" & temp & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
Adodc1.RecordSource = "tsxx"
Adodc1.Refresh
MsgBox "无此图书", , "提示信息"
End If
End Sub
'退出
Private Sub Command2_Click()
End
End Sub
'借书
Private Sub Command3_Click()
If Text5 <> "" Then
MsgBox "借书之前必须先还书", , "提示信息"
Else
temp = InputBox("请输入读者号", "提示信息")
If temp <> "" Then
Text5 = temp
Text6 = "外借于" & Chr$(13) & Chr$(9) & Date
a = Adodc1.Recordset.AbsolutePosition
Adodc1.Recordset.AddNew
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
Adodc1.Refresh
Adodc1.Recordset.Find "图书号='" & a & "'"
End If
End If
End Sub
'还书
Private Sub Command4_Click()
If MsgBox("是否真的要还书?", vbYesNo, "提示信息") = 6 Then
Text5 = ""
Text6 = "在库"
a = Adodc1.Recordset.AbsolutePosition
Adodc1.Recordset.AddNew
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
Adodc1.Refresh
Adodc1.Recordset.Find "图书号='" & a & "'"
End If
End Sub
Private Sub Command5_Click()
Adodc1.Recordset.AddNew "图书号", Adodc1.Recordset.RecordCount + 1
Adodc1.Recordset.Update
Adodc1.Recordset.MoveLast
Text6 = "在库"
Text2 = InputBox("请输入书名", "提示信息")
Text3 = InputBox("请输入作者", "提示信息")
Text4 = Date
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -