查询数量和目标文件夹错误

Number of query and destination folder error

我正在尝试使用 SQL 语句添加新事务。

数据库:MS Access

线路代码:

sqL = "INSERT INTO TableTransactions VALUES('"
        & transno.Text & "','" & cmbmonth.Text & "','" & cmbdate.Text
        & "','" & txtCash.Text & "','" & txtLand.Text & "','"
        & txtADFee.Text & "','" & txtBuilding.Text & "','"
        & txtEquipments.Text & "','" & txtAReceivables.Text
        & "','" & txtAPayable.Text & "','" & txtNPayable.Text
        & "','" & txtSPayable.Text & "','" & txtTPayable.Text
        & "','" & txtCapital.Text & "','" & txtExpenses.Text
        & "','" & txtRevenue.Text & "','" & txtDrawings.Text & "')"

错误:

Number of Query and Destination Folder error.

您必须指定字段的顺序:

sqL = "INSERT INTO TableTransactions (FieldNo, FieldMonth, FieldDate, ... etc.) VALUES('"
    & transno.Text & "','" & cmbmonth.Text & "','" & cmbdate.Text
    & "','" & txtCash.Text & "','" & txtLand.Text & "','"
    & txtADFee.Text & "','" & txtBuilding.Text & "','"
    & txtEquipments.Text & "','" & txtAReceivables.Text
    & "','" & txtAPayable.Text & "','" & txtNPayable.Text
    & "','" & txtSPayable.Text & "','" & txtTPayable.Text
    & "','" & txtCapital.Text & "','" & txtExpenses.Text
    & "','" & txtRevenue.Text & "','" & txtDrawings.Text & "')"

也就是说,请仔细阅读如何使用参数来避免连接模糊并提高安全性。