Access Database update using a link

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

  1. #1

    Default 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 system that contains employee
    information, travel details etc, and im currently working on the employee
    administration section (adding new employees, editing etc).

    The code is working well up to now, and i have built a page that retrieves
    data from the database, and fills a table, i.e. Name, Phone number, etc, and
    this works fine. (note, this is not a form for submission, it is purely a table
    to view the details of that employee)

    At the bottom of the table, i wish to have 4 links, Edit Employee, Demote from
    Manager, Send Message, Delete Employee.

    It is the 'Demote From Manager' Link that i am having trouble with.
    Basically, this text is dynamic, i.e. If the Employee who'se details are on
    screen is actually a manager, the link will say "Demote from Manager", however,
    if the employee is not a manager, the link will say "Make a Manager".

    The code is as follows:

    <cfif IsManager IS 'Yes'>
    Demote from Manager
    <cfelse>
    Make a Manager
    </cfif>

    This section works fine. However, what i want to happen is, when the
    adminisrator clicks "Demote/Make Manager", i want that to be instantly
    reflected in the database.

    I thought about having a link that passed a URL parameter to a processing page
    that did the update, before re-directing using cflocation but im just unsure
    how it would be accomplished.

    Any help would be great,

    Thanks,

    Matt


    Matt McSpirit Guest

  2. Similar Questions and Discussions

    1. Showing the email link from a database link
      Hi Does anyone know how to have an email link show when showing the databse info in a repeating table. Here is the link...
    2. 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...
    3. How to let Shockwave link to database?
      I want to use database in Shockwave3D. Is there interface in Lingo? Or is there any instead way?
    4. Help needed with ASP form browse for file, create link to file and insert in access database
      I have a form where a user enters their name, date etc. i also want them to be able to click on a browse button and select a file which will then...
    5. Link to an external folder AND UPDATE
      I need to create a project with a link to an external folder and a script which reads the folder on startmovie to save all the filenames included in...
  3. #2

    Default Re: Access Database update using a link

    Either put the function in a form with a submit button
    or use a link with URL, such as:

    <cfif IsManager IS 'Yes'>
    <a href="http://actionpage.cfm?action=demote">Demote from Manager</a>
    <cfelse>
    <a href="http://actionpage.cfm?action=promote">Make a Manager</a>
    </cfif>

    On the action page, look for
    #URL.action#
    which will be either "demote" or "promote", then update your db accordingly.


    Matt McSpirit wrote:
    > 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 system that contains employee
    > information, travel details etc, and im currently working on the employee
    > administration section (adding new employees, editing etc).
    >
    > The code is working well up to now, and i have built a page that retrieves
    > data from the database, and fills a table, i.e. Name, Phone number, etc, and
    > this works fine. (note, this is not a form for submission, it is purely a table
    > to view the details of that employee)
    >
    > At the bottom of the table, i wish to have 4 links, Edit Employee, Demote from
    > Manager, Send Message, Delete Employee.
    >
    > It is the 'Demote From Manager' Link that i am having trouble with.
    > Basically, this text is dynamic, i.e. If the Employee who'se details are on
    > screen is actually a manager, the link will say "Demote from Manager", however,
    > if the employee is not a manager, the link will say "Make a Manager".
    >
    > The code is as follows:
    >
    > <cfif IsManager IS 'Yes'>
    > Demote from Manager
    > <cfelse>
    > Make a Manager
    > </cfif>
    >
    > This section works fine. However, what i want to happen is, when the
    > adminisrator clicks "Demote/Make Manager", i want that to be instantly
    > reflected in the database.
    >
    > I thought about having a link that passed a URL parameter to a processing page
    > that did the update, before re-directing using cflocation but im just unsure
    > how it would be accomplished.
    >
    > Any help would be great,
    >
    > Thanks,
    >
    > Matt
    >
    >
    ben Guest

  4. #3

    Default Re: Access Database update using a link

    Excellent, thanks for that, its working perfectly.

    Cheers,

    Matt
    Matt McSpirit 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