Solved

editing table that will then update access database

Posted on 2003-10-30
3
147 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

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.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 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