How to update my access to current date??

D

D

Hi, got a problem here. I try using the following sql statement..

strSQL = "UPDATE Messages(TABLE) SET Date=now() where MessageID=25"

The error given to me:
Syntax error in UPDATE statement.

I'm doing an update of the date already stored in my Access. How do i
resolve this problem?? Thanks

cheers
 
B

Bob Barrows [MVP]

D said:
Hi, got a problem here. I try using the following sql statement..

strSQL = "UPDATE Messages(TABLE) SET Date=now() where MessageID=25"

The error given to me:
Syntax error in UPDATE statement.

I'm doing an update of the date already stored in my Access. How do i
resolve this problem?? Thanks

John is correct. You used a reserved keyword for a column name (Date). This
should be avoided, but if you cannot change the column name, you can work
around it by surrounding the column name with brackets [] when you use it in
your sql statements executed via ADO:

... SET [Date]=now() ...

For more words to avoid in your databases, see here:
http://www.aspfaq.com/show.asp?id=2080

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top