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

  1. #1

    Default 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 getting a message that says I need to have a number placed in the cst_id,
    it can't be left blank. My question is -- how do I do this using cfinsert, or
    can I do this using cfinsert?

    I have included the code I have so far



    <cfinsert datasource="irish"
    tablename="tbl_customers"
    formfields = "CST_FIRSTNAME,
    CST_LASTNAME,
    CST_ADDRESS1,
    CST_ADDRESS2,
    CST_CITY,
    CST_ZIP,
    CST_PHONE,
    CST_EMAIL">

    jhutchdublin Guest

  2. Similar Questions and Discussions

    1. about cfinsert tag error!
      please look this code: <cfif IsDefined("Form.posted")> <cfinsert datasource="test" tablename="users"...
    2. 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...
    3. cfinsert from javascript
      I have write javascript to create form field when button is click. function addEvent(myTable){ var lastRow = myTable.rows.length; var...
    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: cfinsert help

    Is cst_ID the primary key of tbl_customers?

    If so, you should make sure that the field is set as Primary key and that the identity is turned on. This way the value is set by the DB engine.

    dmuniz Guest

  4. #3

    Default Re: cfinsert help

    This has been set by the primary key for the database
    jhutchdublin Guest

  5. #4

    Default Re: cfinsert help

    Originally posted by: jhutchdublin
    This has been set by the primary key for the database

    If your db autoincrements that field for you, change your cfinsert to a
    cfquery and things will work better.

    Dan Bracuk 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