Help with MC ACESS insert please

Discussion in 'Programming' started by danjapro, Feb 20, 2009.

  1. #1
    Here is my SQL statment ot my MC ACCESS db.

    "insert into PLAN.[plan] (name, price, PLAN.[desc], feature_post_profile, feature_view_profile, feature_upload_photo, feature_upload_video, feature_upload_audio, feature_quick_search, feature_detailed_search, feature_save_search, feature_add_favorites, feature_send_messages, feature_receive_messages, feature_chat, feature_more_photo, paypal, length) values ('" & name & "', " & price & ", '" & desc & "', 0" & feature_post_profile & ", 0" & feature_view_profile & ", 0" & feature_upload_photo & ", 0" & feature_upload_video & ", 0" & feature_upload_audio & ", 0" & feature_quick_search & ", 0" & feature_detailed_search & ", 0" & feature_save_search & ", 0" & feature_add_favorites & ", 0" & feature_send_messages & ", 0" & feature_receive_messages & ", 0" & feature_chat & ", 0" & feature_more_photo & ", '" & paypal & "', 0" & length & ")"
    	response.write sql
    	conn.execute(sql)
    end function
    Code (markup):
    I can't seem to see the error I get in syntax, with incorrect parameter. It was coded for SQL not MC Access originally, help with syntax please.
     
    danjapro, Feb 20, 2009 IP
  2. CubicleGuy

    CubicleGuy Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't understand the purpose of the "0" characters that precede 14 of your variable in your list. Try taking those out. You've also got some expressions that would seem to indicate that you want quotemark characters to be included as part of the value of the string specified as the value of the field (see "name", "desc" and "paypal").

    Is that any help for you?

    "insert into PLAN.[plan]
    (name,
    price,
    PLAN.[desc],
    feature_post_profile,
    feature_view_profile,
    feature_upload_photo,
    feature_upload_video,
    feature_upload_audio,
    feature_quick_search,
    feature_detailed_search,
    feature_save_search,
    feature_add_favorites,
    feature_send_messages,
    feature_receive_messages,
    feature_chat,
    feature_more_photo,
    paypal,
    length)
    values
    (" & name & ",
    " & price & ",
    " & desc & ",
    " & feature_post_profile & ",
    " & feature_view_profile & ",
    " & feature_upload_photo & ",
    " & feature_upload_video & ",
    " & feature_upload_audio & ",
    " & feature_quick_search & ",
    " & feature_detailed_search & ",
    " & feature_save_search & ",
    " & feature_add_favorites & ",
    " & feature_send_messages & ",
    " & feature_receive_messages & ",
    " & feature_chat & ",
    " & feature_more_photo & ",
    " & paypal & ",
    " & length & ")"

    Try that and see if that makes any difference.
     
    CubicleGuy, Feb 21, 2009 IP