Solved

editing table that will then update access database

Posted on 2003-10-30
3
146 Views
Last Modified: 2013-12-24
hi ya

i have the following data, i would like the user to be able to change the carstatus in the table which will also update the database,can someone plz show me how to do it.
it doesnt matter how its done,either by radio buttons,text etc


<CFQUERY NAME="CarQuery" DATASOURCE="../dno/ser3">
  SELECT * FROM Cars
</CFQUERY>

<TABLE border="2" >
        <TR>
          <TH> Car ID </HT>
          <TH> Car_Status </HT>
        </TR>
      <CFOUTPUT QUERY="CarQuery">  
        <TR align="left">
         <TD>#CarQuery.CarID#</TD>
         <TD>#CarQuery.Car_Status#</TD>
        </TR>
      </CFOUTPUT>
</table>
0
Comment
Question by:abababa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
anandkp earned 115 total points
ID: 9655547
give the user a form to edit the car status like


<CFQUERY NAME="CarQuery" DATASOURCE="../dno/ser3">
  SELECT * FROM Cars
</CFQUERY>

<TABLE BORDER="2" >
      <FORM NAME="frm" ACTION="updatestatus.cfm" METHOD="post">
      <TR>
        <TH> Car ID </HT>
        <TH> Car_Status </HT>
      </TR>
    <CFOUTPUT QUERY="CarQuery">  
      <TR ALIGN="left">
        <TD>#CarQuery.CarID#<INPUT TYPE="Hidden" NAME="carid" VALUE="#CarQuery.CarID#"></TD>
        <TD><INPUT NAME="carstatus" VALUE="#CarQuery.Car_Status#"></TD>
      </TR>
    </CFOUTPUT>
      </FORM>
</TABLE>

<!--- updatestatus.cfm --->

<CFIF ISDEFINED('CARSTATUS') & LEN(TRIM(CARSTATUS))>
      <CFQUERY NAME="Qry_Update" DATASOURCE="Dsn">
        Update mytable
            set carstatus = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#carstatus#">
            where carid = <CFQUERYPARAM CFSQLTYPE="cf_sql_numeric" VALUE="#carid#">
    </CFQUERY>
</CFIF>

<CFLOCATION URL="updatedone.htm" ADDTOKEN="No">

HTH

K'Rgds
Anand
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Firewall Speed Issue 6 76
retrieving files from old server once DNS has changed 10 72
Internal DNS Zone Issue 13 88
exchange 2010 turning off 3des ciphers 2 450
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question