Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to update my access to current date??

Reply
Thread Tools

How to update my access to current date??

 
 
D
Guest
Posts: n/a
 
      10-02-2004
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      10-02-2004
If Date is a field, name it myDate instead of Date (reserved word)

<D> schreef in bericht news:(E-Mail Removed)...
> 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
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-02-2004
D wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
using the current method name within current method Matthew Heidemann Ruby 14 03-22-2011 03:56 AM
Thread.current.parent and Thread.current.ancestors ara.t.howard@noaa.gov Ruby 3 02-16-2007 03:34 PM
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
How to change the current thread current culture at run time. Manu ASP .Net 1 07-20-2003 03:27 PM



Advertisments