【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-book_insert.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Begin VB.Form book_insert
Caption = "新书录入"
ClientHeight = 5835
ClientLeft = 60
ClientTop = 345
ClientWidth = 7905
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 5835
ScaleWidth = 7905
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "导入"
Height = 495
Left = 5400
TabIndex = 18
Top = 5040
Width = 1215
End
Begin VB.TextBox Text7
Height = 735
Left = 1920
MultiLine = -1 'True
TabIndex = 7
Top = 4080
Width = 5415
End
Begin VB.ComboBox Combo1
Height = 330
Left = 1920
Style = 2 'Dropdown List
TabIndex = 2
Top = 1680
Width = 2295
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 0
Top = 480
Width = 2295
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 3
Top = 2280
Width = 1095
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 1
Top = 1080
Width = 4215
End
Begin VB.TextBox Text4
Height = 375
Left = 5520
TabIndex = 4
Top = 2280
Width = 1815
End
Begin VB.TextBox Text5
Height = 375
Left = 1920
TabIndex = 5
Top = 2880
Width = 3615
End
Begin VB.TextBox Text6
Height = 375
Left = 1920
TabIndex = 6
Top = 3480
Width = 5415
End
Begin VB.CommandButton Command2
Caption = "录入"
Height = 495
Left = 1440
TabIndex = 8
Top = 5040
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 495
Left = 3360
TabIndex = 9
Top = 5040
Width = 1215
End
Begin VB.Label Label8
Caption = "简介:"
Height = 375
Left = 600
TabIndex = 17
Top = 4080
Width = 1095
End
Begin VB.Label Label2
Caption = "类别:"
Height = 375
Left = 600
TabIndex = 16
Top = 1680
Width = 1215
End
Begin VB.Label Label1
Caption = "书号:"
Height = 375
Left = 600
TabIndex = 15
Top = 480
Width = 1095
End
Begin VB.Label Label3
Caption = "书名:"
Height = 375
Left = 600
TabIndex = 14
Top = 1080
Width = 1095
End
Begin VB.Label Label4
Caption = "作者:"
Height = 375
Left = 600
TabIndex = 13
Top = 2280
Width = 855
End
Begin VB.Label Label5
Caption = "出版社:"
Height = 375
Left = 600
TabIndex = 12
Top = 2880
Width = 1095
End
Begin VB.Label Label6
Caption = "定价:"
Height = 375
Left = 4080
TabIndex = 11
Top = 2280
Width = 1095
End
Begin VB.Label Label7
Caption = "出版日期:"
Height = 375
Left = 600
TabIndex = 10
Top = 3480
Width = 1095
End
End
Attribute VB_Name = "book_insert"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
book_input.Show
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, 1, 1
If rs.EOF <> True Then
MsgBox "该书号已经存在!请确认"
Else
rs.Close
If Text3.Text <> "" Then
sql = "select * from info_book "
rs.Open sql, cn, 3, 2
rs.AddNew
rs("bno") = Trim(Text1.Text)
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 "录入成功"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End If
End If
End Sub
Private Sub Form_Activate()
Text1.SetFocus
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_2.cpp
下一篇:
竞赛中运动员的心理障碍与心理训练分析