Friday, September 9, 2005

Syntax error in Update command

This .net error is a pain, but so simple when you know how!

I was using oledb to update access (I know it shouldn't ever be used as a web database!)

However when running the query

'update users set password = 'value' where userid = 1'

.NET through up Syntax error in Update command, yet the query works in access

However password is a reserved word, so to get the query working using .NET change it to:

'update users set [password] = 'value' where userid = 1'

A full list of reserved words can be found here

2 comments:

  1. i thought your blog was cool and i think you may like this cool Website. now just Click Here

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete