📄 frmadd.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmAdd
BorderStyle = 1 'Fixed Single
Caption = "Form2"
ClientHeight = 3945
ClientLeft = 45
ClientTop = 330
ClientWidth = 6615
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3945
ScaleWidth = 6615
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 3000
Top = 5040
Width = 1200
_ExtentX = 2117
_ExtentY = 661
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 = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
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 MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1200
TabIndex = 13
Top = 2640
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
Format = 25034753
CurrentDate = 38853
End
Begin VB.TextBox Text5
Height = 375
Left = 1200
TabIndex = 12
Top = 3240
Width = 3615
End
Begin VB.TextBox Text3
Height = 390
Left = 1200
TabIndex = 11
Top = 1920
Width = 3495
End
Begin VB.TextBox Text2
Height = 270
Left = 960
TabIndex = 1
Top = 840
Width = 3255
End
Begin VB.TextBox Text1
Height = 270
Left = 960
TabIndex = 2
Top = 1440
Width = 855
End
Begin VB.CommandButton Command2
Caption = "确定(&O)"
Default = -1 'True
Height = 375
Left = 5280
TabIndex = 3
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "退出(&C)"
Height = 375
Left = 5280
TabIndex = 0
Top = 3240
Width = 1095
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "库存"
Height = 180
Left = 240
TabIndex = 10
Top = 3360
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "出厂日期"
Height = 180
Left = 240
TabIndex = 9
Top = 2760
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "出厂厂商"
Height = 195
Left = 240
TabIndex = 8
Top = 2040
Width = 720
End
Begin VB.Label Label1
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "System"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 300
Left = 960
TabIndex = 7
Top = 240
Width = 3240
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "条码值"
Height = 180
Left = 240
TabIndex = 6
Top = 300
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "物品名"
Height = 180
Left = 240
TabIndex = 5
Top = 840
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "价格"
Height = 180
Left = 240
TabIndex = 4
Top = 1440
Width = 360
End
End
Attribute VB_Name = "frmAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset("条码") = Label1.Caption
Adodc1.Recordset("商品名称") = Text2.Text
Adodc1.Recordset("价格") = Text1.Text
Adodc1.Recordset("库存") = Text5.Text
Adodc1.Recordset("生产商") = Text3.Text
Adodc1.Recordset("进货日期") = DTPicker1.Value
Adodc1.Recordset.Update
Adodc1.Refresh
MsgBox "该商品已经存入数据库中!!", vbInformation, "提示"
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.CommandType = adCmdText
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\store.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from store"
Adodc1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -