Access Database will not update

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

  1. #1

    Default Access Database will not update

    I've got CF7 running on WinXP SP2 with Access 2000 database. Very simple table
    - 4 fields, all text except the Key. I can view, I can Insert, but I can't
    update. No error is thrown. I am using cfupdate with formfields attribute. I
    gave up using SQL Update because I kept getting errors from Access ODBC even
    though I felt the sentax was correct. I would appreciate any ideas.

    Thanks

    KJ Klosson Guest

  2. Similar Questions and Discussions

    1. update database
      I have a database where I need to input values that I calculate. I only need to do this once, so I wanted to write a template to do this quickly. I...
    2. Access Database update using a link
      Hi guys, Im pretty new to CF, but im learning fast yet ive become a litte unstuck with this problem. Im producing a small web based database...
    3. Database Update Error
      I have a guestbook form that inserts the fields into an Access Database. The database is residing in the "fpdb" folder that was created by...
    4. Write Access to Access DataBase
      I'm trying to update a Access Database from information gained from a ASPX page. The database will not update. I'm sure it is in some security...
    5. update from between database
      I have a Informix Database on Solaris and a SQL database. I need to update from Informix to SQL daily. Is there any easy way of doing it? BTW, I...
  3. #2

    Default Re: Access Database will not update

    Can you post some code?
    >I gave up using SQL Update because I kept getting errors from Access ODBC
    even
    >though I felt the sentax was correct.
    That probably means it is not correct ;-) or perhaps you're using reserved
    words as column names.

    mxstu Guest

  4. #3

    Default Re: Access Database will not update

    Thanks, and yes I have tested that the action for is in Edit mode...

    FIRST IS THE USER FORM...

    <cfset EditMode=IsDefined("form.userid")>
    <cfif EditMode>
    <cfquery name="getuser" datasource="#application.datasource#">
    Select * FROM User WHERE UserID=#form.userid#
    </cfquery>

    <cfset userid=#getuser.userid#>
    <cfset last=TRIM(getuser.last)>
    <cfset first=TRIM(getuser.first)>
    <cfset telephone=TRIM(getuser.telephone)>
    <cfset ext=TRIM(getuser.ext)>
    <cfset email=TRIM(getuser.email)>
    <cfset role=TRIM(getuser.role)>
    <cfset opmnumber=#session.opm#>
    <cfset tabtext="Edit-" & #first# & ' ' & #last#>
    <cfelse>
    <cfset last="">
    <cfset first="">
    <cfset telephone="">
    <cfset ext="">
    <cfset email="">
    <cfset role="">
    <cfset opmnumber=#session.opm#>
    <cfset tabtext="New User">
    </cfif>

    <cfform name="userform" width="400" height="500" format="flash"
    action="UserFormAction.cfm"
    method="post">
    <cfformgroup type="tabnavigator">
    <cfformgroup type="page" label="#tabtext#">
    <cfinput type="text" name="last" value="#last#" width="150" label="Last
    Name:" required="yes">
    <cfinput type="text" name="first" value="#first#" width="150" label="First
    Name:" required="yes">
    <cfinput type="text" name="telephone" value="#telephone#"
    label="Telephone:" required="yes"
    width="150" tooltip="Example: 800-555-1212 24">
    <cfinput type="text" name="ext" value="#ext#" label="Ext.:" required="no"
    width="50">
    <cfinput type="text" name="email" value="#email#" label="Email:"
    width="250" validate="email" message="Must be an email address." required="yes">
    <cfinput type="checkbox" name="emailcredentials" checked="true"
    label="Email credentials to user">
    <cfinput type="hidden" name="opmnumber" value="#opmnumber#">
    <cfif EditMode>
    <cfinput type="hidden" name="UserID">
    </cfif>
    </cfformgroup>
    </cfformgroup>
    <cfinput type="submit" name="submit" value="Save">
    </cfform>


    THEN THE ACTION FORM...

    <cfinclude template="usermenu.cfm">
    <cfset EditMode=IsDefined("form.userid")>
    <cfif editmode>
    <cfupdate datasource="#application.datasource#" tablename="User"
    formfields="UserID,Last,First,Telephone,Ext,Email" >
    <cfset action="Updated">
    <cfelse>
    <cfinsert datasource="#application.datasource#" tablename="User"
    formfields="Last,First,Telephone,Ext,Email">
    <cfset action="Added">
    </cfif>

    KJ Klosson Guest

  5. #4

    Default Re: Access Database will not update

    > <cfinput type="hidden" name="UserID">
    Don't you need to give the form field a value?
    mxstu Guest

  6. #5

    Default Re: Access Database will not update

    Your right. Thank you!
    KJ Klosson 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