问题描述
- 程序报错,说至少有一个参数值没有被指定
-
Private Sub Form_Load()
'器材类别信息加入到equAdd组合框中
Dim rs As New ADODB.Recordset
Dim sqlType As String
sqlType = "select typename from equtype order by typename"
Set rs = TransactSQL(sqlType)
While Not rs.EOF
equType.AddItem rs(0)
rs.MoveNext
Wend
rs.Close'操作选择 If ModifyEqFlag2 = True Then 'Dim rs As New ADODB.Recordset Dim sql As String sql = "select * from equs where equNO ='" & ModifyEqFlag1 & "'" Set rs = TransactSQL(sql) equNo.Text = rs.Fields(0) equNo.Locked = True ' 使不可改动 equMod.Text = rs.Fields(1) equLen.Text = rs.Fields(2) equName.Text = rs.Fields(3) equEngName.Text = rs.Fields(4) equPinyin.Text = rs.Fields(5) equNece.Text = rs.Fields(6) equBrand.Text = rs.Fields(7) equType.Text = rs.Fields(8) equBuyDTP.Value = rs.Fields(9) equSim.Text = rs.Fields(10) equOri.Text = rs.Fields(11) equPrice.Text = rs.Fields(12) equEnrolDTP.Value = rs.Fields(13) equOther.Text = rs.Fields(14) ModifyEqFlag2 = ModifyEqFlag2 Xor True addEqOK.Enabled = False
Else
modifyEqOK.Enabled = False
End If
End SubPrivate Sub modifyEqOK_Click()
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "update equs set equNo= '" & equNo.Text & "',equmod='" & equMod.Text & "'"
sql = sql & ",equlen='" & equLen.Text & "',equname='" & equName.Text & "'"
sql = sql & ",equengname='" & equEngName.Text & "',equpinyin='" & equPinyin.Text & "'"
sql = sql & ",equnece='" & equNece.Text & "',equbrand='" & equBrand.Text & "'"
sql = sql & ",equtype='" & equType.Text & "',equbuydate='" & Format(equBuyDTP.Value, "yyyy-mm-dd") & "'"
sql = sql & ",equsim='" & equSim.Text & "',equori='" & equOri.Text & "'"
sql = sql & ",equprice='" & equPrice.Text & "',equenroldate='" & Format(equEnrolDTP.Value, "yyyy-mm-dd") & "'"
sql = sql & ",equother='" & equOther.Text & "' where equno='" & equNo.Text & "'"If Trim(equNo.Text) = "" Or Trim(equMod.Text) = "" Or Trim(equLen.Text) = "" Or _
Trim(equName.Text) = "" Or Trim(equEngName.Text) = "" Or Trim(equPinyin.Text) = "" Or _
Trim(equNece.Text) = "" Or Trim(equBrand.Text) = "" Or Trim(equType.Text) = "" Or _
Trim(equBuyDTP.Value) = "" Or Trim(equSim.Text) = "" Or Trim(equOri.Text) = "" Or _
Trim(equPrice.Text) = "" Or Trim(equEnrolDTP.Value) = "" Or Trim(equOther) = "" Then
MsgBox "器材信息录入不能为空!", vbOKOnly
Else
TransactSQL (sql)
MsgBox "器材信息修改成功!", vbOKOnly
Unload Me
End If
End Sub