Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Angry INSERT INTO troubles... please help!

    Can some one give at shot explaining to me the reason why the following works:
    msgCreate="INSERT INTO userMessages (messageID, message, header, category) VALUES "
    msgCreate=msgCreate & "('" & msgid & "','" & themessage & "','" & thesubject & "','" & thetype & "')"
    Conn.execute msgCreate




    But this gives me an error:
    msgCreate="INSERT INTO userMessages (messageID, message, header, category, from) VALUES "
    msgCreate=msgCreate & "('" & msgid & "','" & themessage & "','" & thesubject & "','" & thetype & "','" & msgsentby & "')"
    Conn.execute msgCreate

    ==========================================================

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

    /thegroupgenesis/final draft/msgcompose.asp, line 94


    line 94 is the Conn.execute msgCreate line


    Once I try putting in the from field, which DOES exist in the table it spits that error.!!!!

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    "from" is a reserved word, if you are going to use it, you need to put brackets around it like so: [from].
    OracleGuy

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Thanks ALOT!!!!

    Worked like a charm!!!! Thanks alot man!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •