【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,frmCPGL.frm,希望对大家有所帮助!
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmCPGL
BorderStyle = 3 'Fixed Dialog
Caption = "产品管理"
ClientHeight = 6000
ClientLeft = 1095
ClientTop = 435
ClientWidth = 8130
Icon = "frmCPGL.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6000
ScaleWidth = 8130
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSDataGridLib.DataGrid dgdCPGL
Align = 1 'Align Top
Bindings = "frmCPGL.frx":030A
Height = 4815
Left = 0
TabIndex = 0
Top = 0
Width = 8130
_ExtentX = 14340
_ExtentY = 8493
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 2
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc adoCPGL
Align = 2 'Align Bottom
Height = 450
Left = 0
Top = 5550
Width = 8130
_ExtentX = 14340
_ExtentY = 794
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 = "PROVIDER=MSDASQL;dsn=PurchaseandSale;uid=sa;pwd=ecc;"
OLEDBString = "PROVIDER=MSDASQL;dsn=PurchaseandSale;uid=sa;pwd=ecc;"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Pass
word = ""
RecordSource = "select 商品名称,产地,规格,包装,单位 from product"
Caption = " "
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command5
Caption = "关闭"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5880
TabIndex = 5
Top = 4920
Width = 975
End
Begin VB.CommandButton Command2
Caption = "修改"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2160
TabIndex = 4
Top = 4920
Width = 975
End
Begin VB.CommandButton Command3
Caption = "删除"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3360
TabIndex = 3
Top = 4920
Width = 975
End
Begin VB.CommandButton Command4
Caption = "保存"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4560
TabIndex = 2
Top = 4920
Width = 1095
End
Begin
VB.CommandButton Command1
Caption = "添加"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 1
Top = 4920
Width = 975
End
End
Attribute VB_Name = "frmCPGL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo AddErr
dgdCPGL.AllowAddNew = True '允许添加新记录
dgdCPGL.AllowUpdate = True '允许编辑记录
dgdCPGL.AllowDelete = False '禁止删除记录
adoCPGL.Recordset.MoveLast '移动到新增加的记录
dgdCPGL.SetFocus
Exit Sub
AddErr:
MsgBox err.Description
End Sub
Privat