【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“reader_delete.frm”一文,供大家参考学习
VERSION 5.00
Begin VB.Form reader_delete
Caption = "注销读者"
ClientHeight = 5385
ClientLeft = 60
ClientTop = 345
ClientWidth = 6435
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 5385
ScaleWidth = 6435
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command4
Caption = "关闭"
Height = 495
Left = 3720
TabIndex = 18
Top = 4560
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "注销"
Height = 495
Left = 1920
TabIndex = 17
Top = 4560
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 2280
TabIndex = 8
Top = 360
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 4800
TabIndex = 7
Top = 360
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 2280
TabIndex = 6
Top = 960
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 4800
TabIndex = 5
Top = 960
Width = 975
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 4
Top = 1680
Width = 975
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 3
Top = 2400
Width = 855
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 2
Top = 3120
Width = 2415
End
Begin VB.TextBox Text6
Enabled = 0 'False
Height = 375
Left = 4920
TabIndex = 1
Top = 2400
Width = 855
End
Begin VB.TextBox Text7
Enabled = 0 'False
Height = 375
Left = 4920
TabIndex = 0
Top = 1680
Width = 855
End
Begin
VB.Label Label9
Caption = "目前状态:"
Height = 495
Left = 480
TabIndex = 19
Top = 3840
Width = 1095
End
Begin VB.Label Label8
ForeColor = &H000000FF&
Height = 375
Left = 1680
TabIndex = 16
Top = 3840
Width = 1095
End
Begin VB.Label Label1
Caption = "借书证号:"
Height = 375
Left = 480
TabIndex = 15
Top = 360
Width = 1455
End
Begin VB.Label Label2
Caption = "姓 名:"
Height = 375
Left = 480
TabIndex = 14
Top = 960
Width = 1455
End
Begin VB.Label Label3
Caption = "性 别:"
Height = 375
Left = 480
TabIndex = 13
Top = 1680
Width = 975
End
Begin VB.Label Label4
Caption = "年 龄:"
Height = 375
Left = 480
TabIndex = 12
Top = 2400
Width = 975
End
Begin VB.Label Label5
Caption = "班 级:"
Height = 375
Left = 480
TabIndex = 11
Top = 3120
Width = 975
End
Begin VB.Label Label6
Caption = "借书数目:"
Height = 375
Left = 3600
TabIndex = 10
Top = 2400
Width = 1455
End
Begin VB.Label Label7
Caption = "欠款金额:"
Height = 375
Left = 3600
TabIndex = 9
Top = 1680
Width = 1335
End
End
Attribute VB_Name = "reader_delete"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rsb As ADODB.Recordset
Dim sum As Integer
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Set rsb = New ADODB.Recordset
sum = 0
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_reader where rno='" & Text1.Text & "'"
rs.Open sql, cn, 3, 2
If rs.EOF = True Then
MsgBox "没有找到该读者"
Else
rno = rs("rno")
Text2.Text = rs("rname")
Text3.Text = rs("rgentle")
Text4.Text = rs("rage")
Text5.Text = rs("rclass")
Text7.Text = rs("rmoney")
If rs("rflag") = 0 Then
Label8.Caption = "可用"
Else
Label8.Caption = "禁用"
End If
sql = "select * from borrow"
rsb.Open sql, cn, 1, 1
Do While rsb.EOF <> True
If rsb("rno") = rs("rno") Then
sum = sum + 1
End If
rsb.MoveNext
Loop
rs("rnum") = sum
rs.Update
Text6.Text = sum
End If
End Sub
Private Sub Command2_Click()
Dim rsb As ADODB.Recordset
Dim sum As Integer
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Set rsb = New ADODB.Recordset
sum = 0
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_reader where rname='" & Text2.Text & "'"
rs.Open
sql, cn, 3, 2
If rs.EOF = True Then
MsgBox "没有找到该读者"
Else
rno = rs("rno")
Text1.Text = rs("rno")
Text3.Text = rs("rgentle")
Text4.Text = rs("rage")
Text5.Text = rs("rclass")
Text7.Text = rs("rmoney")
If rs("rflag") = 0 Then
Label8.Caption = "可用"
Else
Label8.Caption = "禁用"
End If
sql = "select * from borrow"
rsb.Open sql, cn, 1, 1
Do While rsb.EOF <> True
If rsb("rno") = rs("rno") Then
sum = sum + 1
End If
rsb.MoveNext
Loop
rs("rnum") = sum
rs.Update
Text6.Text = sum
End If
End Sub
Private Sub Command3_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;D