【VB开源代码栏目提醒】:本文主要为网学会员提供place_insert.frm,希望对需要place_insert.frm网友有所帮助,学习一下!
VERSION 5.00
Begin VB.Form place_insert
Caption = "考场录入"
ClientHeight = 4695
ClientLeft = 60
ClientTop = 345
ClientWidth = 6765
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 4695
ScaleWidth = 6765
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 5
Top = 360
Width = 1935
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 4
Top = 1080
Width = 3975
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 3
Top = 1800
Width = 1935
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2280
TabIndex = 2
Top = 2520
Width = 3975
End
Begin VB.CommandButton Command1
Caption = "添加"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 1
Top = 3480
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3960
TabIndex = 0
Top = 3480
Width = 1215
End
Begin
VB.Label Label1
Caption = "考场号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 9
Top = 360
Width = 1335
End
Begin VB.Label Label2
Caption = "考场名称:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 8
Top = 1080
Width = 1335
End
Begin VB.Label Label3
Caption = "容纳人数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 7
Top = 1800
Width = 1215
End
Begin VB.Label Label4
Caption = "考场地址:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 6
Top = 2520
Width = 1215
End
End
Attribute VB_Name = "place_insert"
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_place"
rs.Open
sql, cn, 3, 2
If (Text1.Text <> "" And Text2.Text <> "") Then
rs.AddNew
rs("kno") = Trim(Text1.Text)
rs("kname") = Trim(Text2.Text)
rs("knum") = Trim(Text3.Text)
rs("kaddr") = Trim(Text4.Text)
rs.Update
MsgBox "添加成功"
Else
MsgBox "请输入完整信息"
End If
End Sub