Private Function SuppInfo_Add() As Boolean
Dim rst As New ADODB.Recordset
Dim strSQL As String
Dim intRst As Integer
SuppInfo_Add = False
If CheckFaceIsOk = False Then
Exit Function
End If
strSQL = "SELECT * FROM 入库 where 编号 = " & Me.txt5.Text & ""
rst.Open strSQL, cnnDatabase, adOpenStatic, adLockOptimistic
rst.AddNew
rst.Fields("名称").Value = Me.txt1.Text
rst.Fields("入库时间").Value = Me.DT_RegeditDate.Value
rst.Fields("仓管员").Value = Me.txt2.Text
rst.Fields("入库数量").Value = Me.txt3.Text
rst.Fields("编号").Value = Me.txt5.Text
rst.Fields("入库人").Value = Me.txt6.Text
rst.Fields("线体").Value = Me.txt8.Text
If Me.txt4.Text = "" Then
rst.Fields("备注").Value = "无"
Else
rst.Fields("备注").Value = Me.txt4.Text
End If
On Error Resume Next
rst.Update
MsgBox "添加新的物品信息成功!"
Set rst = Nothing
kucun_Add
Initial_Add
SuppInfo_Add = False
Exit Function
End Function实时错误 '-2147217904 (80040e10)'
[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1
Dim rst As New ADODB.Recordset
Dim strSQL As String
Dim intRst As Integer
SuppInfo_Add = False
If CheckFaceIsOk = False Then
Exit Function
End If
strSQL = "SELECT * FROM 入库 where 编号 = " & Me.txt5.Text & ""
rst.Open strSQL, cnnDatabase, adOpenStatic, adLockOptimistic
rst.AddNew
rst.Fields("名称").Value = Me.txt1.Text
rst.Fields("入库时间").Value = Me.DT_RegeditDate.Value
rst.Fields("仓管员").Value = Me.txt2.Text
rst.Fields("入库数量").Value = Me.txt3.Text
rst.Fields("编号").Value = Me.txt5.Text
rst.Fields("入库人").Value = Me.txt6.Text
rst.Fields("线体").Value = Me.txt8.Text
If Me.txt4.Text = "" Then
rst.Fields("备注").Value = "无"
Else
rst.Fields("备注").Value = Me.txt4.Text
End If
On Error Resume Next
rst.Update
MsgBox "添加新的物品信息成功!"
Set rst = Nothing
kucun_Add
Initial_Add
SuppInfo_Add = False
Exit Function
End Function实时错误 '-2147217904 (80040e10)'
[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1
检查连接字符串。
cnnDatabase.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\me.mdb"
http://zhidao.baidu.com/question/154992812.htm
INSERT INTO Authors ( Au_ID, Author ) VALUES ( 54, "Record # 54" )
However, with ADO (to the OLE DB provider for ODBC drivers via the Microsoft Access ODBC driver) this syntax generates an error and fails to execute.
With ADO, this syntax generates an error, 0x80040E10 or -2147217904, or the following error message:
Too few parameters. Expected 1.
Instead, you would have to use the following syntax: INSERT INTO Authors ( Au_ID, Author ) VALUES ( 54, 'Record # 54' )
This is only one example and specific to DAO/Jet.