📄 frmbookreturnupdate.frm
字号:
VERSION 5.00
Begin VB.Form frmBookReturnUpdate
Caption = "书籍还入信息删除"
ClientHeight = 4380
ClientLeft = 60
ClientTop = 450
ClientWidth = 6120
LinkTopic = "Form12"
ScaleHeight = 4380
ScaleWidth = 6120
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 2400
TabIndex = 11
Top = 3720
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 4440
TabIndex = 10
Top = 3720
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "清空"
Height = 375
Left = 480
TabIndex = 9
Top = 3720
Width = 1095
End
Begin VB.TextBox txtBookName
Height = 375
Left = 3120
TabIndex = 8
Top = 1560
Width = 2415
End
Begin VB.TextBox txtDate
Height = 375
Left = 3120
TabIndex = 7
Top = 2160
Width = 2415
End
Begin VB.TextBox txtMemo
Height = 375
Left = 3120
TabIndex = 6
Top = 2760
Width = 2415
End
Begin VB.TextBox txtName
Height = 390
Left = 3120
TabIndex = 5
Top = 960
Width = 2415
End
Begin VB.Label Label6
Caption = "书名"
Height = 255
Left = 360
TabIndex = 4
Top = 1680
Width = 2175
End
Begin VB.Label Label4
Caption = "还书日期"
Height = 255
Left = 360
TabIndex = 3
Top = 2280
Width = 2175
End
Begin VB.Label Label3
Caption = "备注"
Height = 255
Left = 360
TabIndex = 2
Top = 2880
Width = 2175
End
Begin VB.Label Label2
Caption = "借阅者姓名"
Height = 255
Left = 360
TabIndex = 1
Top = 1080
Width = 2175
End
Begin VB.Label Label1
Caption = "输入借阅者姓名或书名点击确定,将调出此书相关信息"
Height = 375
Left = 360
TabIndex = 0
Top = 240
Width = 5175
End
End
Attribute VB_Name = "frmBookReturnUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
txtName.Text = ""
txtBookName.Text = ""
txtDate.Text = ""
txtMemo.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim N As Boolean
N = True
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=book.mdb;Persist Security Info=False"
conn.Open
If Trim(txtName.Text) = "" Then
MsgBox "还书者姓名不能为空", vbOKOnly + vbExclamation, ""
txtName.SetFocus
N = False
End If
If Trim(txtBookName.Text) = "" Then
MsgBox "书名不能为空", vbOKOnly + vbExclamation, ""
N = False
End If
If Trim(txtDate.Text) = "" Then
MsgBox "日期不能为空", vbOKOnly + vbExclamation, ""
txtDate.SetFocus
N = False
End If
If N = True Then
sql = "select * from ReturnInfo where UserName ='" + txtName.Text + "'and BookName='" + txtBookName.Text + "'and Date='" + txtDate.Text + "'"
rs.Open sql, conn, adOpenKeyset, adLockPessimistic
If Not rs.EOF Then
rs.Delete
rs.Update
MsgBox "书籍还入信息已经删除", vbOKOnly + vbExclamation, ""
Else
MsgBox "书籍还入信息不存在", vbOKOnly + vbExclamation, ""
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -