【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,lend.frm,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form lend
Caption = "归还书籍"
ClientHeight = 5445
ClientLeft = 60
ClientTop = 345
ClientWidth = 8625
LinkTopic = "Form1"
ScaleHeight = 5445
ScaleWidth = 8625
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 6120
TabIndex = 23
Top = 4080
Width = 2175
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 21
Top = 4080
Width = 2175
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 6120
TabIndex = 19
Top = 3480
Width = 2175
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 17
Top = 3480
Width = 2175
End
Begin VB.TextBox Text8
Height = 375
Left = 3000
TabIndex = 0
Top = 360
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 5520
TabIndex = 8
Top = 360
Width = 975
End
Begin VB.TextBox Text9
Enabled = 0 'False
Height = 615
Left = 1440
MultiLine = -1 'True
TabIndex = 7
Top = 2640
Width = 4095
End
Begin VB.TextBox Text10
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 6
Top = 1560
Width = 2175
End
Begin VB.TextBox Text11
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 5
Top = 960
Width = 3495
End
Begin VB.TextBox Text12
Enabled = 0 'False
Height = 375
Left = 6120
TabIndex = 4
Top = 1560
Width = 2175
End
Begin VB.TextBox Text13
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 3
Top = 2160
Width = 3255
End
Begin VB.TextBox Text14
Enabled = 0 'False
Height = 375
Left = 6120
TabIndex = 2
Top = 2160
Width = 1935
End
Begin VB.TextBox Text15
Enabled = 0 'False
Height = 375
Left = 6120
TabIndex = 1
Top = 960
Width = 2175
End
Begin VB.Label Label4
Caption = "超期天数:"
Height = 375
Left = 5160
TabIndex = 24
Top = 4080
Width = 975
End
Begin VB.Label Label3
Caption = "借阅时间:"
Height = 375
Left = 360
TabIndex = 22
Top = 4080
Width = 975
End
Begin VB.Label Label2
Caption = "姓 名:"
Height = 375
Left = 5160
TabIndex = 20
Top = 3480
Width = 975
End
Begin VB.Label Label1
Caption = "借书证号:"
Height = 375
Left = 360
TabIndex = 18
Top = 3480
Width = 975
End
Begin VB.Label Label8
Caption = "书 号:"
Height = 375
Left = 1200
TabIndex = 16
Top = 360
Width = 1335
End
Begin VB.Label Label9
Caption = "简 介:"
Height = 255
Left = 360
TabIndex = 15
Top = 2760
Width = 855
End
Begin VB.Label Label10
Caption = "作 者:"
Height = 375
Left = 360
TabIndex = 14
Top = 1680
Width = 855
End
Begin VB.Label Label11
Caption = "书 名:"
Height = 255
Left = 360
TabIndex = 13
Top = 1080
Width = 855
End
Begin VB.Label Label12
Caption = "类 别:"
Height = 375
Left = 5160
TabIndex = 12
Top = 1680
Width = 1095
End
Begin VB.Label Label13
Caption = "出版社:"
Height = 255
Left = 360
TabIndex = 11
Top = 2280
Width = 855
End
Begin VB.Label Label14
Caption = "出版时间:"
Height = 255
Left = 5160
TabIndex = 10
Top = 2160
Width = 975
End
Begin VB.Label Label15
Caption = "定 价:"
Height = 375
Left = 5160
TabIndex = 9
Top = 1080
Width = 1095
End
End
Attribute VB_Name = "lend"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Set rsb = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_book where bno='" & Text8.Text & "'"
rs.Open sql, cn, 3, 2
If rs.EOF = True Then
MsgBox "该书号为非法书号"
Else
If rs("flag") = 1 Then
MsgBox "操作错误!请确认书号"
Text8.Text = ""
Text8.SetFocus
Else
Text11.Text = rs("bname")
Text15.Text = rs("bprice")
Text10.Text = rs("bauthor")
Text12.Text = rs("btype")
Text13.Text = rs("bpublish")
Text14.Text = rs("bdate")
Text9.Text = rs("bmemo")
rs("flag") = 1
rs.Update
End If
rs.Close
End If
sql = "select * from borrow where bno='" & Text8.Text & " '"
rs.Open sql, cn, 3, 2
If rs.EOF = True Then
MsgBox "该书已还或未借出"
Else
Text1.Text = rs("rno")
Text2.Text = rs("rname")
Text3.Text = rs("time")
Text4.Text = (Format(Now, "yyyymmdd") - Format(rs("time"), "yyyymmdd") - 30)
If Text4.Text < 0 Then
Text4.Text = 0
End If
rs.Delete
End If
rs.Close
sql = "select * from info_reader where rno='" & Text1.Text & "' "
rs.Open sql, cn, 3, 2
rs("rnum") = rs("rnum") - 1
rs("rmoney") = rs("rmoney") + Val((Text4.Text)) * 10
rs.Update
MsgBox "还书成功"
Text8.Text = ""
Text8.SetFocus
Text11.Text = ""
Text15.Text = ""
Text12.Text = ""
Text10.Text = ""
Text13.Text = ""
Text14.Text = ""
Text9.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
上一篇:
MCIWavPlay.cpp
下一篇:
春天的兰花草