查询中的语法错误

时间:2015-10-09 15:29:52

标签: sql vb.net ms-access

With cmd
    .Connection = con
    .CommandTimeout = 0
    .CommandText = "INSERT INTO tableContacts (NameUser, Address, City, Phone, Fax, Note, Email) VALUES (@NameUser, @Address, @City, @Phone, @Fax, @Note, @Email)"
    With .Parameters
        .AddWithValue("@NameUser", txtName.Text)
        .AddWithValue("@Address", txtAddress.Text)
        .AddWithValue("@City", txtCity.Text)
        .AddWithValue("@Phone", txtPhone.Text)
        .AddWithValue("@Fax", txtFax)
        .AddWithValue("@Note", txtNote.Text)
        .AddWithValue("@Email", txtTo.Text)

    End With

    Try
        cmd.ExecuteNonQuery()
    Catch ex As Exception

    End Try
    .Dispose()
End With

无法找到问题所在。

所有调试器都说:

  

{" INSERT INTO语句中的语法错误。"}

0 个答案:

没有答案