- Sep 23, 2003
- 11,449
- 264
- 126
I've researched this online and from what I've gathered, this is an actual bug with using ADO vs DAO, however this entire program is already written using ADO so I'm hoping there is a workaround.
Basically I have an UPDATE statement that uses a WHERE clause on the AutoNumber field (this brings the result to exactly one row in the table).
The SQL statement works when I execute it through an external SQL program connecting to the exact same database, so I know the SQL command is proper and formatted correctly. The correct line in the database updates correctly.
However when I execute this through the macro it gives me an error of:
Run-time error '-2147217900 (80040e14)':
Syntax error in UPDATE statement
This command worked previously as well, it is only when I added fields to the database that it caused problems. Actually now that I type through this I can probably create a new database and see if it works on a fresh build altogether. However, the fact that it works through Microsoft SQL when I copy and paste the exact same command leads me to believe it still wont work.
Ideas?
SOLUTION:
I figured it out. The problem is I named a field "OPEN". The insert function does not have a problem with this, but the update function does in VBA SQL. I have fixed the problem. Thanks for looking.
Basically I have an UPDATE statement that uses a WHERE clause on the AutoNumber field (this brings the result to exactly one row in the table).
The SQL statement works when I execute it through an external SQL program connecting to the exact same database, so I know the SQL command is proper and formatted correctly. The correct line in the database updates correctly.
However when I execute this through the macro it gives me an error of:
Run-time error '-2147217900 (80040e14)':
Syntax error in UPDATE statement
This command worked previously as well, it is only when I added fields to the database that it caused problems. Actually now that I type through this I can probably create a new database and see if it works on a fresh build altogether. However, the fact that it works through Microsoft SQL when I copy and paste the exact same command leads me to believe it still wont work.
Ideas?
SOLUTION:
I figured it out. The problem is I named a field "OPEN". The insert function does not have a problem with this, but the update function does in VBA SQL. I have fixed the problem. Thanks for looking.
Last edited:
