插入查询时出现语法错误(MS Access)

时间:2013-07-16 20:44:23

标签: visual-studio-2010 insert ms-access-2007 syntax-error vb.net-2010

我正在使用Visual Studio 2010和MS Access 2007

我无法解决错误

调试时,“Insert Into”中出现“语法错误”但是sql语法是正确的 我是vb.net的新手,如果有人能给我一个解决方案,我将不胜感激。

   Try
        Dim query As String = "INSERT INTO User([ID],[StudName],Address])VALUES('002','haerth','col')"
        Dim comLib As New OleDbCommand
        With comLib
            .CommandText = query
            .Connection = conLib
            .ExecuteNonQuery()
        End With
        MessageBox.Show("Added Successfully")
    Catch ex As OleDbException
        MessageBox.Show(ex.ToString)
    End Try

`

1 个答案:

答案 0 :(得分:2)

您的括号不匹配:地址]