Solved

editing table that will then update access database

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IIS url rewrite rule for web application 3 62
Configure IIS to process JSON 10 88
apply ddos protection on all network interface 2 124
Domino Website - Redirection 12 84
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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