Re: How to update my access to current date??

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 10/02/04


Date: Sat, 2 Oct 2004 07:21:54 -0400

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" 


Relevant Pages

  • Re: Syntax error in INSERT INTO statement.
    ... > I got syntax error in INSERT INTO statement. ... Run the page and look at the sql statement in the browser window. ... This email account is my spam trap so I ...
    (microsoft.public.scripting.vbscript)
  • Re: How to update my access to current date??
    ... schreef in bericht news:OyLw6GFqEHA.644@tk2msftngp13.phx.gbl... ... I try using the following sql statement.. ... > Syntax error in UPDATE statement. ...
    (microsoft.public.inetserver.asp.general)
  • How to update my access to current date??
    ... I try using the following sql statement.. ... Syntax error in UPDATE statement. ... resolve this problem?? ...
    (microsoft.public.inetserver.asp.general)
  • SQL Update problem
    ... The following SQL statement is resulting in the error after it: ... JET Database Engine Description: Syntax error in UPDATE statement. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Expression Builder
    ... Open the query in Design View. ... This is what the SQL statement shows: ... This email account is my spam trap so ...
    (microsoft.public.access.queries)

Loading