Ask a Question related to Coldfusion Database Access, Design and Development.
-
Samurai_Sjakkie #1
updating a database.
at the moment is am trying to create a page to update a database.
i select the a company in a list which the gets forwarded to the next page. On
the next page i tell the page that the it has to display all the information
from the selected company by telling it that "Where #form.companytxt# =
CompanyCode"
the problem i am getting is that it puts all the information into a form.
however when i want to update the form it refers to "companytxt" from the above
statement. And as it is not in this form it is getting confused. what would be
the best way of doing this?
Samurai_Sjakkie Guest
-
updating database
I posted this in the general dis part too but maybe this is better place since it has to do with forms... here is my problem I need to overcome.... -
MS Access Database not Updating
Hi, I am working on creating dynamic home pages with Coldfusion MX on the server, Dreamweaver for developing and Microsoft Access as the backend... -
Updating a Database
Hi I am just learning asp.net and have hit a wall with the datagrid control. I have populated a datagrid and am able to edit fields and retrieve... -
SQL not Updating Access Database
Hi, I have an ASP page that updates an Access 2000 database. It doesnt seem to update the date field of the table. Here is the SQL: Update... -
Updating Database with ASP
Hi, I'm just learning how to use ASP and I've been trying to figure out how to add records to my database. I'm learning it out of a book and... -
Samurai_Sjakkie #2
Re: updating a database.
i was thinking could i have something where it refers to form1(first page) to get the company name and form2 (second page) to update the sql database?
Samurai_Sjakkie Guest
-
jdeline #3
Re: updating a database.
It seems as though your WHERE clause is backwards. It probably should be WHERE companyCode = '#form.companyTxt#'
jdeline Guest
-
Samurai_Sjakkie #4
Re: updating a database.
even changing that it cant find find it after i click update.
would it be handier to do an
<cfif not isdefined (#form.companytxt#)>
cflocation ****firstpage*****
<cfidelse>
cflocation *****this page ?sid=#form.companytxt#
</cfif>
and then set the where statement to companyCode = '#URL.SIDt#'
I think the problem is with the dropdown menu select in the previous
page.........
Samurai_Sjakkie Guest
-
Dan Bracuk #5
Re: updating a database.
If you managed to pass a company code from a select from page 1 to page 2, the
problem is not with page 1. Question, what are you doing with the company
code on page 2? If you are not converting it to a session variable or a hidden
form field on your page 2 form, how are you going to know what record to update
on page 3?
Dan Bracuk Guest
-
Samurai_Sjakkie #6
Re: updating a database.
i am totally new to this.but i thought i had created a hidden field...
<input type="hidden" name="companytxt" value="#form.companytxt#">
but this didn't work.....
Stupdi question but how do i convert it to a session variable?
Samurai_Sjakkie Guest
-
Dan Bracuk #7
Re: updating a database.
To convert it to a session variable,
<cfset session.companytxt = form.companytxt>
Before you do that, put this at the top of page 3.
<cfdump var="#form#">
<cfabort>
Does your hidden field show up?
Dan Bracuk Guest
-
Samurai_Sjakkie #8
Re: updating a database.
Coldfusion is harder than i thought. i have got the following done so far...
but then i get the error
Parameter 1 of function IsDefined, which is now
'2B617C71-B310-4D13-B9At3AFBE454FDE1', must be a syntactically valid variable
name. how do i remove the "e; ?
<!---Set A list of values --->
<cfquery name="retrieve" datasource="test1">
SELECT *
From company
where CompanyCode = "#form.companytxt#";
</cfquery>
<CFIF NOT IsDefined (#form.companytxt#)>
<CFLOCATION URL="main.cfm">
</cfif>
<!--- Create the list that needs to bee edited. --->
<!--- To Modify the list --->
<cfoutput><form action="companyupdate.cfm" method="post">
<table width="90%" border="1">
<tr>
<td><table border="0">
<tr>
<td>Supplier Name</td>
<td><input type="hidden" name="companytxt"
value="#retrieve.CompanyCode#"</td>
<td><input name="CompanyName" value="#retrieve.CompanyName#"
size="40"></td>
</tr>
<tr>
<td>Adress 1</td>
<td></td>
<td><input name="Address1" value="#retrieve.Address#"
size="40"></td>
</tr>
<tr>
<td>City</td>
<td></td>
<td><input name="City" value="#retrieve.City#" size="40"></td>
</tr>
<tr>
<td>PostCode</td>
<td></td>
<td><input name="Postcode" value="#retrieve.PostCode#"
size="40"></td>
</tr>
</table></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr></tr>
<tr>
<td>
<tr>
<td ><input name="" type="checkbox" value="ModCheck"></td>
<td>Are you sure you would like to update The Details.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td></td>
<td><div align="center">
<input type="Submit" name="updateDB" value="Update">
</div></td>
</tr>
</table></td>
</tr>
</table>
</form>
</cfoutput>
Samurai_Sjakkie Guest



Reply With Quote

