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
    New Coder
    Join Date
    Aug 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Insert Into Synatx error

    I just know im makeing a stupid mistake but no matter what i try (reserverd words and such) i have no luck debuging this one line of code:

    Code:
    set Exe = oConn.Execute("INSERT INTO sales_reps SET (username, vpassword, first_name, last_name, address, city, vstate, zip, home_phone, cell_phone, email, location_tag, ses_number) VALUES ('"& username &"', '"& password &"', '"& first_name &"', '"& last_name &"', '"& Address &"', '"& vCity &"', '"& vState &"', '"& Zip &"', '"& HomePhone &"', '"& CellPhone &"', '"& Email &"', '"& LocationTag &"', '"& SESNumber &"')")
    the error it returns is a syntax error:

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

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

    /testindc/sunrise/save_new_rep.asp, line 31

    all names were copied and pasted form the originals. if anyone sees my mistake any help would be greatly apprecieated.
    Last edited by guelphdad; 08-21-2006 at 03:43 PM.

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    The word SET does not belong in an INSERT statement. that is throwing your error.

    note, when posting code please use [ code] and [/code] tags around your code. without the space in the first tag.

    you should also mention that you are using COLDFUSION or whatever application if you are using the code above because it won't be inserted into mysql directly with those & symbols in your values.

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. sry about the formating stuff. i knew it had to be something like that. just sliped my eye.


  •  

    Posting Permissions

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