syntax error in insert into

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jason.a.thompson@gmail.com

    syntax error in insert into

    Can someone tell me what is the syntax error in the following line of
    code?

    db.Execute ("insert into data (timestamp) values (now())")

  • Randy Harris

    #2
    Re: syntax error in insert into


    <jason.a.thomps on@gmail.com> wrote in message
    news:1115218608 .724993.103640@ o13g2000cwo.goo glegroups.com.. .[color=blue]
    > Can someone tell me what is the syntax error in the following line of
    > code?
    >
    > db.Execute ("insert into data (timestamp) values (now())")[/color]

    Try this:
    db.Execute ("insert into data (timestamp) values (#" & now() & "#)")



    Comment

    • jason.a.thompson@gmail.com

      #3
      Re: syntax error in insert into

      Doesn't seem to make a difference. Thanks though.

      Comment

      • Di

        #4
        Re: syntax error in insert into

        db.Execute ("insert into data(timestamp1 ) values(#" & Now() & "#);")
        works.

        TimeStamp is a MS Jet DB Engine reserved word. It is probably reserved
        in both upper and lower case (I think??), don't think you can use it as
        a column name.

        D...

        Comment

        • Randy Harris

          #5
          Re: syntax error in insert into

          "Di" <diahann.gooden @bpb-na.com> wrote in message
          news:1115228539 .033302.275630@ z14g2000cwz.goo glegroups.com.. .[color=blue]
          > db.Execute ("insert into data(timestamp1 ) values(#" & Now() & "#);")
          > works.
          >
          > TimeStamp is a MS Jet DB Engine reserved word. It is probably reserved
          > in both upper and lower case (I think??), don't think you can use it as
          > a column name.
          >
          > D...[/color]

          Oops, D is right - timestamp is a reserved word. I missed that.


          Comment

          Working...