Hasith Malinga
Hasith Malinga

Reputation: 3

Syntax Error occured in Insert into query(MS Access)

I'm using Visual Studio 2010 and MS Access 2007

I can't fix the error

when debugging, "Syntax error in Insert Into" is occurred but sql syntax is correct I'm new to vb.net and it would be grateful if anyone can give me a solution.

   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

`

Upvotes: 0

Views: 641

Answers (1)

Yttric
Yttric

Reputation: 36

You have a bracket mismatch: Address]

Upvotes: 2

Related Questions