a problem about cfinsert&sql.insert

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default a problem about cfinsert&sql.insert

    hi~

    when i insert data into form,there is a stranger things happend:
    when i insert with one value ,it's ok,but when changing the number of the
    value ,the wrong happens.System show me the sql statement cause this error.the
    code blow:
    <---!---blow this is ok--------------------->
    <cfquery datasource="myDB">
    insert into mytable(userID,
    password)
    values("#form.userID#")
    </cfquery>
    <---!blow this cause wrong---->
    <cfquery datasource="myDB">
    insert into mytable(userID,
    password)
    values("#form.userID#",
    "#form.password#")
    </cfquery>

    ps:i use coldfusion 7.0 database is access2003
    ps:Please forgive my poor English!

    justay Guest

  2. Similar Questions and Discussions

    1. cfinsert help
      I would like to have people insert information into a database. It's a single table in a database, so I thought I would try <cfinsert> I'm...
    2. about cfinsert tag error!
      please look this code: <cfif IsDefined("Form.posted")> <cfinsert datasource="test" tablename="users"...
    3. insert using cfinsert
      I have been trying to upgrade my server from CF 5 to CF 7. I have a table as keywords with the attributes as follows: ID int (primary key) keyword...
    4. CFInsert
      Hi. I was hoping I could get help on an issue. I am using CFInsert to add data from a form into two tables that are related. Table 1: Members...
    5. CFinsert misbehaves
      Any ideas why a CFinsert tag would work on my partner's desktop and not on my laptop? Both are using CF 6.0 and MS Access database. All the...
  3. #2

    Default Re: a problem about cfinsert&sql.insert

    Post the complete error message.

    Regards
    Sojovi Guest

  4. #3

    Default Re: a problem about cfinsert&sql.insert

    the error message blow:
    --------------------------------
    The error occurred in C:\CFusionMX7\wwwroot\web\insert.cfm: line 5

    3 : <cfquery datasource="ACCDB">
    4 : insert into userInf(userID,password)
    5 : values('#form.userID#','#form.password#')
    6 : </cfquery>
    7 :




    --------------------------------------------------------------------------------

    SQL insert into userInf(userID,password) values('qweqwrqw1231',"124123423")

    DATASOURCE ACCDB
    VENDORERRORCODE 3092
    SQLSTATE &nbsp;

    Thanks for your help!



    justay Guest

  5. #4

    Default Re: a problem about cfinsert&sql.insert

    Looks like you have a problem with tje value of #form.password#, as it is enclosed in double quotes for some reason: "124123423" What is setting this form variable?

    Phil
    paross1 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139