📄 frmhwbm.frm
字号:
VERSION 5.00
Begin VB.Form frmHwbm
Caption = "货物资料新增"
ClientHeight = 2355
ClientLeft = 4245
ClientTop = 3150
ClientWidth = 6030
LinkTopic = "Form2"
ScaleHeight = 2355
ScaleWidth = 6030
Begin VB.CommandButton Command
Caption = "保存(&S)"
Height = 345
Index = 2
Left = 4830
TabIndex = 7
Top = 90
Width = 1125
End
Begin VB.Frame Frame
Height = 2145
Left = 30
TabIndex = 1
Top = 90
Width = 4695
Begin VB.TextBox Text
Height = 330
Index = 3
Left = 1110
TabIndex = 10
Top = 270
Width = 2025
End
Begin VB.TextBox Text
Height = 330
Index = 2
Left = 1110
TabIndex = 8
Top = 1620
Width = 2025
End
Begin VB.TextBox Text
Height = 330
Index = 0
Left = 1110
TabIndex = 3
Top = 720
Width = 2025
End
Begin VB.TextBox Text
Height = 330
Index = 1
Left = 1110
TabIndex = 2
Top = 1170
Width = 3315
End
Begin VB.Label Label
Caption = "货物单价:"
Height = 195
Index = 3
Left = 210
TabIndex = 9
Top = 1680
Width = 825
End
Begin VB.Label Label
Caption = "货物编码:"
Height = 195
Index = 0
Left = 180
TabIndex = 6
Top = 780
Width = 825
End
Begin VB.Label Label
Caption = "货物名称:"
Height = 195
Index = 1
Left = 180
TabIndex = 5
Top = 1230
Width = 825
End
Begin VB.Label Label
Caption = "货物分类:"
Height = 195
Index = 2
Left = 180
TabIndex = 4
Top = 330
Width = 825
End
End
Begin VB.CommandButton Command
Caption = "退出(&X)"
Height = 345
Index = 1
Left = 4830
TabIndex = 0
Top = 510
Width = 1125
End
End
Attribute VB_Name = "frmHwbm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const TxtHwBmFlCode = 3
Const TxtHwBmCode = 0
Const TxtHwBmMc = 1
Const TxtHwBmPrice = 2
Const CmdSave = 2
Const CmdExit = 1
Private Sub Command_Click(Index As Integer)
On Error GoTo Errorhandle
Select Case Index
Case CmdSave
SaveRecord
Case CmdExit
Unload Me
End Select
Exit Sub
Errorhandle:
MsgBox Err.Description
End Sub
Private Sub SaveRecord()
Dim ConnStr As String
Dim Conn As ADODB.Connection
Dim Cmd As ADODB.Command
On Error GoTo Errorhandle
ConnStr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=;Initial Catalog=fiterp;Data Source=ERP002"
Set Conn = New ADODB.Connection
Conn.ConnectionString = ConnStr
Conn.Open
Set Cmd = New ADODB.Command
Set Cmd.ActiveConnection = Conn
Cmd.CommandText = "{CALL VBSQLPROADD(?,?,?,?)}"
Cmd(0) = Trim(Text(TxtHwBmFlCode).Text)
Cmd(1) = Trim(Text(TxtHwBmCode).Text)
Cmd(2) = Trim(Text(TxtHwBmMc).Text)
Cmd(3) = Val(Text(TxtHwBmPrice).Text)
Conn.BeginTrans
Cmd.Execute
Conn.CommitTrans
Set Cmd = Nothing
Set Conn = Nothing
Exit Sub
Errorhandle:
Conn.RollbackTrans
Set Cmd = Nothing
Set Conn = Nothing
Err.Raise vbObjectError + 1, , Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -