Ask a Question related to Coldfusion Database Access, Design and Development.
-
Howard Perlman #1
UPDATE using a query?
I thought something would be easy, but I'm lost. Quickly, I'm making a form to
sign up employees for a training course. The selection is 1 of 4 dates, then a
box for completed (Y/N). First trying to update dates. I read the employee name
(Access primary key) and have a string field for date. I am able to fill out
the form with the current date picked (radio buttons for now). I need to be
able to edit the dates chosen and then, I imagine, use SQL UPDATE to write the
data back to the table. But, the employees come out of an Acces table, and I
get lost trying to assign the NAME field in the <CFINPUT> tag. If I assign them
the same name for each record, then all date fields on the screen are a single
NAME. Clicking the radio button for different employees turns off all other
fields. Makes sense. So I tried using the Access table field for employee name
as the NAME field, such as: <cfinput type='radio' name='#strLotusID#'
value='05/13/2005' checked='#checked#'> Thus, every record displayed is
different, so that works for displaying the current data. But, when I submit
the form, I don't know how to construct my UPDATE statement. I would be happy
just to use the CFQUERY tag to go through all employees and update the date
field with the new date (even if it wasn't changed). Using the employee name
as the key, I tried this update: <cfquery datasource='Safety' name='updating'>
UPDATE tbl.CPR SET strDATE = '#form.strLotusID#' </cfquery> First of
all, are all the date fields passed to the Action file from the form at all? Or
can you only update 1 record at a time (I didn't think so). Or do I have to
fill up an Array with the data to write and then feed that in a loop to UPDATE?
Or do I have to create a new field, and ID number, in the employee table and
and use that in the WHERE clause? Does anyone see what I'm trying to do? I
feel it might not be clear unless you are trying this yourself! Thanks, Howard
Perlman US Geological Survey [email]hperlman@usgs.gov[/email] The logic of this seems wrong.
I was hoping I
Howard Perlman Guest
-
Looping an update query
Hello Everyone, I would like to change the rank of some items. So i got a table tbl_rank with: ID, item, rank (rank: 1,2,3,4,5,...) The way i... -
Update Query.. asp/access db
Hi, Does anybody know what this error is about? ____ Microsoft OLE DB Provider for ODBC Drivers error '80004005' Operation must use an... -
SQL Update Query Error
can someone tell me what is wrong with this query? I've tried every combo that I can think of - adding &,"", "'", ) everywhere I can think of and I... -
Update query help
I'd like to update some of the fields in a table 'master', where some of the data in a row already exists. For example, I'd like to add to a record... -
Append & Update Query???
Before the queries are run, set SetWarnings False, then SetWarnings True after you've run. BTW, it's possible to do update and append in a single... -
paross1 #2
Re: UPDATE using a query?
I'm not exactly sure if I understand what you are trying to do, but is this
close?
<cfinput type="radio" name="SchedDate" value="05/13/2005" checked="#checked#">
<input type="hidden" name="userID" value = "strLotusID#">
paross1 Guest



Reply With Quote

