📄 frmborrowbook.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Frmborrowbook
Caption = "Form1"
ClientHeight = 4410
ClientLeft = 60
ClientTop = 465
ClientWidth = 6615
LinkTopic = "Form1"
ScaleHeight = 4410
ScaleWidth = 6615
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 2520
Top = 3720
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"Frmborrowbook.frx":0000
OLEDBString = $"Frmborrowbook.frx":008C
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from book_message where book_id="""""
Caption = "Adodc1"
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.CommandButton Command2
Caption = "返 回"
Height = 444
Left = 5160
TabIndex = 8
Top = 3720
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "我要借"
Height = 495
Left = 360
TabIndex = 7
Top = 3720
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Frmborrowbook.frx":0118
Height = 1455
Left = 240
TabIndex = 6
Top = 2040
Width = 6135
_ExtentX = 10821
_ExtentY = 2566
_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 = 4
BeginProperty Column00
DataField = "book_id"
Caption = "图书编号"
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 = "book_name"
Caption = "图书名称"
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 = "book_type"
Caption = "图书类型"
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 = "book_author"
Caption = "作者"
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
EndProperty
BeginProperty Column01
EndProperty
BeginProperty Column02
EndProperty
BeginProperty Column03
EndProperty
EndProperty
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Frmborrowbook.frx":012D
Left = 1560
List = "Frmborrowbook.frx":013D
TabIndex = 2
Top = 720
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 1
Top = 1200
Width = 2535
End
Begin VB.CommandButton Command1
Caption = "搜 索"
Enabled = 0 'False
Height = 444
Left = 4440
TabIndex = 0
Top = 1200
Width = 1095
End
Begin VB.Frame Frame1
Caption = "借 书"
Height = 1455
Left = 240
TabIndex = 3
Top = 360
Width = 6135
Begin VB.Label Label1
Caption = "选择查询类别:"
Height = 255
Left = 120
TabIndex = 5
Top = 360
Width = 1455
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "输入关键字:"
Height = 255
Left = 240
TabIndex = 4
Top = 840
Width = 1095
End
End
End
Attribute VB_Name = "Frmborrowbook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sqltxt As String
Dim Time As String
Dim Borrow_id As String
Public Sub Find()
Dim id As String
Dim i, x As Integer
If Combo1.Text = "书籍编号" Then
'Sqltxt = "select * from book_message where book_id =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = "book_id"
End If
If Combo1.Text = "书籍名称" Then
'Sqltxt = "select * from book_message where book_name =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = "book_name"
End If
If Combo1.Text = "类别" Then
'Sqltxt = "select * from book_message where book_type =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = "book_type"
End If
If Combo1.Text = "作者" Then
'Sqltxt = "select * from book_message where book_author =" & " '" & Text1.Text & "'"
'Set cnn = st.Execute(Sqltxt)
Sqltxt = "book_author"
End If
End Sub
Private Sub Combo1_Click()
Find
End Sub
Private Sub Command1_Click()
Find
'Sqltxt = "book_id"
'Adodc1.RecordSource = "select * from book_message where" & Sqltxt & "=" & " '" & 1002 & "'"
Adodc1.RecordSource = "select * from book_message where book_borrow='可借' and " & Sqltxt & "=" & "'" & Text1.Text & "'"
Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
'set_window
Open_Student_message
Do While cnn.EOF = False
If cnn.EOF = True Then
Exit Do
End If
If cnn.Fields(0).Value = student_ic Then
If cnn.Fields(6).Value > 0 Then
MsgBox "你欠费啦!不能借书。"
Exit Sub
End If
End If
cnn.MoveNext
Loop
Open_borrow_book
'MsgBox window_no
If Borrow_no < window_no Then
Borrow_no = Borrow_no + 1
cnn.AddNew
cnn.Fields(0).Value = student_ic
cnn.Fields(1).Value = student_id
cnn.Fields(2).Value = student_name
DataGrid1.Col = 0
cnn.Fields(3).Value = DataGrid1.Text
Borrow_id = DataGrid1.Text
DataGrid1.Col = 1
cnn.Fields(4).Value = DataGrid1.Text
DataGrid1.Col = 2
cnn.Fields(5).Value = DataGrid1.Text
'Time = Date$
cnn.Fields(6).Value = Date$
cnn.Fields(7).Value = DateAdd("m", window_time, Date$)
cnn.Fields(8).Value = 0
cnn.Fields(9).Value = student_class
cnn.Update
MsgBox "借书成功!"
Open_book_message
Do While cnn.EOF = False
If cnn.EOF = True Then
Exit Do
End If
If cnn.Fields(0).Value = Borrow_id Then
cnn.Fields(9).Value = "已借"
End If
cnn.MoveNext
Loop
Else
MsgBox "你已经借了" & window_no & "本书,不可以借书啦!"
End If
Open_Student_message
Do While cnn.EOF = False
If cnn.EOF = True Then
Exit Sub
End If
If cnn.Fields(0).Value = student_ic Then
cnn.Fields(5).Value = Borrow_no
End If
cnn.MoveNext
Loop
End Sub
Private Sub Text1_Change()
If Text1.Text = "" And Combo1.Text = "" Then
Command1.Enabled = False
Else
Command1.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -