Not able able to insert data into access table

Posted 13 March 2011 - 04:17 AM

I am trying to insert data into access table using VB.Net 2008. But each time I am getting error: "Syntax error in INSERT INTO statement".
I typed following code. Please suggest me if anyone knows the solution.

Re: Not able able to insert data into access table

Time is a reserved keyword and it's confused by it thinking you're trying to perform some function that it doesn't have all the information for. By wrapping it in square brackets you are denoting it as a field.

Re: Not able able to insert data into access table

It is because Time is a keyword and the sql statment thinks you are trying to use the time function. When you wrap your Fields in square brackets you are telling the interpreter that these are fields.

If you read my post above the solution was there. The reason your code is working is because you are no longer specifying fields and letting the interpreter do it for you which it handles by defaulting to all fields in the database being wrapped with square brackets.