【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“place_update.frm”一文,供大家参考学习!
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form place_update
Caption = "考场信息维护"
ClientHeight = 6435
ClientLeft = 60
ClientTop = 345
ClientWidth = 6285
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 6435
ScaleWidth = 6285
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3840
Top = 240
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Pass
word = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ListBox List1
DataSource = "Adodc1"
Height = 4680
ItemData = "place_update.frx":0000
Left = 480
List = "place_update.frx":0002
TabIndex = 7
Top = 240
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 3840
TabIndex = 6
Top = 840
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
Left = 3840
TabIndex = 5
Top = 1560
Width = 1575
End
Begin VB.TextBox Text3
Height = 375
Left = 3840
TabIndex = 4
Top = 2280
Width = 1575
End
Begin VB.TextBox Text4
Height = 1215
Left = 3840
MultiLine = -1 'True
TabIndex = 3
Top = 3000
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "修改"
Height = 495
Left = 1080
TabIndex = 2
Top = 5640
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 495
Left = 2880
TabIndex = 1
Top = 5640
Width = 1095
End
Begin
VB.CommandButton Command3
Caption = "关闭"
Height = 495
Left = 4680
TabIndex = 0
Top = 5640
Width = 1095
End
Begin VB.Label Label1
Caption = "考场号:"
Height = 375
Left = 2760
TabIndex = 11
Top = 840
Width = 975
End
Begin VB.Label Label2
Caption = "容纳人数:"
Height = 375
Left = 2760
TabIndex = 10
Top = 1560
Width = 1095
End
Begin VB.Label Label3
Caption = "考场名称:"
Height = 375
Left = 2760
TabIndex = 9
Top = 2280
Width = 1095
End
Begin VB.Label Label4
Caption = "考场地址:"
Height = 375
Left = 2760
TabIndex = 8
Top = 3000
Width = 1095
End
End
Attribute VB_Name = "place_update"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim str As String
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
str = Trim(List1.Text)
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_place where kname='" & str & "'"
rs.Open sql, cn, 3, 2
rs("kno") = Trim(Text1.Text)
rs("kname") = Trim(Text3.Text)
rs("knum") = Trim(Text2.Text)
rs("kaddr") = Trim(Text4.Text)
rs.Update
MsgBox "修改成功"
Adodc1.Refresh
List1.Refresh
End Sub
Private Sub Command2_Click()
Dim str As String
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
str = Trim(List1.Text)
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_place where kname='" & str & "'"
rs.Open sql, cn, 3, 2
response = MsgBox("确定要删除此考场吗?", vbOKCancel + 32, "提示")
If response = vbOK Then
rs.Delete
MsgBox "删除成功"
Adodc1.Refresh
List1.Refresh
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End If
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
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, 1, 1
Do While rs.EOF <> True
List1.AddItem rs("kname")
rs.MoveNext
Loop
End Sub
Private Sub List1_Click()
Dim str As String
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="