Problem:

User keeps getting the following ADO/ODBC error when trying to insert records into a Microsoft Access database via SQL and RPG2SQL:
 
999 ERR-2147217900 [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
 

Solution:

Make sure not to use reserved SQL keywords as field names in SQL databases. 
 
Possible SQL reserved keywords include:
  • SELECT
  • GROUP
  • ORDER
  • FROM
  • BY
  • WHERE
-or-
 
If a user gets the same error number and they are using an @ symbol in the table name, make sure to put [ ] around the table name.  The reason is that SQL uses @ for variable names. Table names with @ symbols are misidentified as variables if not bracketed with [ ].
 
Example:
 
Rtn = SQL_RunSQLExec(SQL_Socket:
'insert into [@NameAddr] '

 


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016