【VB开源代码栏目提醒】:网学会员在VB开源代码频道为大家收集整理了book_update.frm提供大家参考,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form book_update
Caption = "书籍更新"
ClientHeight = 6180
ClientLeft = 60
ClientTop = 345
ClientWidth = 8280
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 6180
ScaleWidth = 8280
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command4
Caption = "取消"
Height = 495
Left = 6240
TabIndex = 19
Top = 5280
Width = 975
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 495
Left = 4080
TabIndex = 18
Top = 5280
Width = 975
End
Begin VB.CommandButton Command2
Caption = "修改"
Height = 495
Left = 1680
TabIndex = 17
Top = 5280
Width = 975
End
Begin VB.TextBox Text6
Height = 375
Left = 2040
TabIndex = 9
Top = 3480
Width = 5415
End
Begin VB.TextBox Text5
Height = 375
Left = 2040
TabIndex = 8
Top = 2880
Width = 3615
End
Begin VB.TextBox Text4
Height = 375
Left = 5640
TabIndex = 7
Top = 2280
Width = 1815
End
Begin VB.TextBox Text3
Height = 375
Left = 2040
TabIndex = 6
Top = 1080
Width = 4215
End
Begin VB.TextBox Text2
Height = 375
Left = 2040
TabIndex = 5
Top = 2280
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 330
Left = 2040
TabIndex = 4
Top = 1680
Width = 2295
End
Begin VB.TextBox Text7
Height = 735
Left = 2040
MultiLine = -1 'True
TabIndex = 3
Top = 4080
Width = 5415
End
Begin VB.CommandButton Command1
Caption = "查找"
Height = 495
Left = 5400
TabIndex = 2
Top = 240
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 2760
TabIndex = 1
Top = 240
Width = 2295
End
Begin VB.Label Label7
Caption = "出版日期:"
Height = 375
Left = 720
TabIndex = 16
Top = 3480
Width = 1095
End
Begin VB.Label Label6
Caption = "定价:"
Height = 375
Left = 4200
TabIndex = 15
Top = 2280
Width = 1095
End
Begin VB.Label Label5
Caption = "出版社:"
Height = 375
Left = 720
TabIndex = 14
Top = 2880
Width = 1095
End
Begin VB.Label Label4
Caption = "作者:"
Height = 375
Left = 720
TabIndex = 13
Top = 2280
Width = 855
End
Begin VB.Label Label3
Caption = "书名:"
Height = 375
Left = 720
TabIndex = 12
Top = 1080
Width = 1095
End
Begin VB.Label Label2
Caption = "类别:"
Height = 375
Left = 720
TabIndex = 11
Top = 1680
Width = 1215
End
Begin VB.Label Label8
Caption = "简介:"
Height = 375
Left = 720
TabIndex = 10
Top = 4080
Width = 1095
End
Begin VB.Label Label1
Caption = "输入书号:"
Height = 495
Left = 1440
TabIndex = 0
Top = 240
Width = 1095
End
End
Attribute VB_Name = "book_update"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Set cn = New ADODB.Connection
Set rs = 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='" & Text1.Text & "'"
rs.Open sql, cn, 1, 1
If rs.EOF = True Then
MsgBox "没有找到该书"
Else
Text3.Text = rs("bname")
Combo1.Text = rs("btype")
Text2.Text = rs("bauthor")
Text4.Text = rs("bprice")
Text5.Text = rs("bpublish")
Text6.Text = rs("bdate")
Text7.Text = rs("bmemo")
End If
End Sub
Private Sub Command2_Click()
Set cn = New ADODB.Connection
Set rs = 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='" & Text1.Text & "'"
rs.Open sql, cn, 3, 2
rs("bname") = Trim(Text3.Text)
rs("btype") = Trim(Combo1.Text)
rs("bauthor") = Trim(Text2.Text)
rs("bprice") = Trim(Text4.Text)
rs("bpublish") = Trim(Text5.Text)
rs("bdate") = Trim(Text6.Text)
rs("bmemo") = Trim(Text7.Text)
rs.Update
MsgBox "该书信息已成功修改"
End Sub
Private Sub Command3_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from type bno='" & Text1.Text & "'"
rs.Open sql, cn, 3, 2
response = MsgBox("确定要删除该书所有信息吗?", vbOKCancel + 32, "提示")
If response = vbOK Then
rs.Delete
MsgBox "删除成功"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo1.Text = ""
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from type "
rs.Open sql, cn, 1, 1
Do While rs.EOF <> True
Combo1.AddItem rs("tname")
rs.MoveNext
Loop
End Sub
上一篇:
CSDI_3Doc.cpp
下一篇:
论文-基于Android的大学图书管理系统