【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“addnew.frm”一文,供大家参考学习
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form Form1
Caption = "修改记录"
ClientHeight = 3270
ClientLeft = 60
ClientTop = 345
ClientWidth = 6225
LinkTopic = "Form1"
ScaleHeight = 3270
ScaleWidth = 6225
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "保存记录"
Height = 375
Left = 4560
TabIndex = 13
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "修改记录"
Height = 375
Left = 3120
TabIndex = 7
Top = 2760
Width = 1215
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "addnew.frx":0000
Height = 2535
Left = 0
OleObjectBlob = "addnew.frx":0014
TabIndex = 6
Top = 120
Width = 2895
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 240
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "作者"
Top = 2760
Width = 2175
End
Begin VB.Frame Frame1
Height = 2655
Left = 3000
TabIndex = 0
Top = 0
Width = 2895
Begin VB.TextBox Text1
DataField = "城市"
DataSource = "Data1"
Height = 375
Index = 4
Left = 1200
TabIndex = 5
Text = "Text1"
Top = 2160
Width = 1455
End
Begin VB.TextBox Text1
DataField = "住址"
DataSource = "Data1"
Height = 375
Index = 3
Left = 1200
TabIndex = 4
Text = "Text1"
Top = 1680
Width = 1455
End
Begin VB.TextBox Text1
DataField = "电话"
DataSource = "Data1"
Height = 375
Index = 2
Left = 1200
TabIndex = 3
Text = "Text1"
Top = 1200
Width = 1455
End
Begin VB.TextBox Text1
DataField = ""
DataSource = "Data1"
Height = 375
Index = 1
Left = 1200
TabIndex = 2
Text = "Text1"
Top = 720
Width = 1455
End
Begin
VB.TextBox Text1
DataField = "编号"
DataSource = "Data1"
Height = 375
Index = 0
Left = 1200
TabIndex = 1
Text = "Text1"
Top = 240
Width = 1455
End
Begin VB.Label Label5
Caption = "城市"
Height = 255
Left = 120
TabIndex = 12
Top = 2160
Width = 855
End
Begin VB.Label Label4
Caption = "住址"
Height = 255
Left = 120
TabIndex = 11
Top = 1680
Width = 495
End
Begin VB.Label Label3
Caption = "电话"
Height = 255
Left = 120
TabIndex = 10
Top = 1200
Width = 615
End
Begin VB.Label Label2
Caption = ""
Height = 255
Left = 120
TabIndex = 9
Top = 720
Width = 615
End
Begin VB.Label Label1
Caption = "编号"
Height = 255
Left = 120
TabIndex = 8
Top = 240
Width = 615
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************************
'**模 块 名:Form1
'**网 址:www.mingrisoft.com 价值无限,服务无限
'**电 话:(0431)84978981,84978982
'**创 建 人:明日科技
'**日 期:2007-11-21
'**修 改 人:MRLBB
'**日 期:2007-11-21
'*************************************************************************
Private Sub Command1_Click() '修改记录
Data1.Recordset.Edit
End Sub
Private Sub Command2_Click() '更新记录
On Error Resume Next
Data1.Recordset.Update
End Sub
Private Sub Form_Load() '连接数据库
Data1.DatabaseName = "" & App.Path & "\book2.mdb"
End Sub