Hi I am not coldfusion professional, but I have to check this and correct the problem (weird). Our hosting company change a web server, which cause some of the pages stop working. They didn’t produce an error but keep waiting. Can anyone help me in correct this code so it can work with new server? (This was worked fine with previous web server). Please see the following code:- <cfsilent> <!--- Set location for highlighting in Nav Menu ---> <cfset strSelectNav = "Options"> <!--- Set Local Variable for currently selected option ---> <cfparam name="URL.optionID" default="0"> <cfparam name="ThisOption" default="#URL.optionID#"> <!--- Set Page Archive Status ---> <cfparam name="URL.OptionView" default="0"> <!--- Set default Action value ---> <cfparam name="FORM.action" default=""> <cfif isdefined ("FORM.action") AND FORM.action EQ "DisplayProducts"> <cfquery name="qGetSelectedProducts" datasource="#request.dsn#"> SELECT * FROM prod_table, prdtthrdcat_rel WHERE prod_table.product_ID = prdtthrdcat_rel.prdt_thrd_rel_Product_ID AND prdtthrdcat_rel.prdt_thrd_rel_ThrdCat_ID = #FORM.thrdctgry_ID# </cfquery> <cfset SelectedProducts = ValueList(qGetSelectedProducts.product_ID)> </cfif> <cfif isdefined ("FORM.action") AND FORM.action EQ "UpdateProducts"> <cfquery name="qDeleteProducts" datasource="#request.dsn#"> DELETE FROM prdtthrdcat_rel WHERE prdt_thrd_rel_ThrdCat_ID = #FORM.thrdctgry_ID# </cfquery> <cfif isdefined ("FORM.Product_ID")> <CFLOOP LIST="#FORM.Product_ID#" INDEX="ThisProduct"> <cfquery name="qInsertProducts" datasource="#request.dsn#"> INSERT INTO prdtthrdcat_rel (prdt_thrd_rel_Product_ID, prdt_thrd_rel_ThrdCat_ID) VALUES (#ThisProduct#, #FORM.thrdctgry_ID#); </cfquery> </cfloop> </cfif> </cfif> <!--- Get Record ---> <cfquery name="qGetCats" datasource="#request.dsn#"> SELECT * FROM prdtcategories, prdtscndcats, prdtthrdcats WHERE prdtcategories.category_ID = prdtscndcats.category_ID AND prdtthrdcats.scndctgry_ID = prdtscndcats.scndctgry_ID ORDER BY prdtcategories.category_ID, prdtscndcats.scndctgry_ID </cfquery> <cfquery name="qGetProducts" datasource="#request.dsn#"> SELECT * FROM prod_table Where Product_ID=Product_ID </cfquery> <cfquery name="qGetThrdCats" datasource="#request.dsn#"> SELECT DISTINCT prdt_thrd_rel_Product_ID FROM prdtthrdcat_rel </cfquery> <cfset ProductList = ValueList(qGetThrdCats.prdt_thrd_rel_Product_ID)> </cfsilent> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Sofa World Admin</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="assets/admin.css" rel="stylesheet" type="text/css"> </head> <body> <!--- Include Admin Navigation Menu---> <cfinclude template="CWIncNav.cfm"> <div id="divMainContent"> <cfform name="Add" method="POST" action="#Request.ThisPageQS#" enctype="multipart/form-data"> <p><strong>Please select the category you would like to view. <br> You can then select all the ranges you wish to add to that category.<br> <br> If you need to add a new category, please do so by selecting 'Type Cats' from the Sub Categories menu on the left hand side </strong><br /> <br /> <cfparam name="FORM.category_ID" default="0"> <cfparam name="FORM.scndctgry_ID" default="0"> <cfparam name="FORM.thrdctgry_ID" default="0"> </p> <CF_ThreeSelectsRelated QUERY="qGetCats" NAME1="category_ID" NAME2="scndctgry_ID" NAME3="thrdctgry_ID" VALUE1="category_ID" VALUE2="scndctgry_ID" VALUE3="thrdctgry_ID" DISPLAY1="category_Name" DISPLAY2="scndctgry_Name" DISPLAY3="thrdctgry_Name" DEFAULT1="#FORM.category_ID#" DEFAULT2="#FORM.scndctgry_ID#" DEFAULT3="#FORM.thrdctgry_ID#" EMPTYTEXT1="-- Select --" EMPTYTEXT2="-- Select --" EMPTYTEXT3="-- Select --" SIZE1="1" SIZE2="1" SIZE3="1" WIDTH1="150" WIDTH2="150" WIDTH3="300" MULTIPLE3="No" ONCHANGE="this.form.submit();"> <br /> <br /> <input name="action" type="hidden" value="DisplayProducts"> <cfif isdefined ("FORM.category_ID")> <cfquery name="qGetCat1" datasource="#request.dsn#"> SELECT * FROM prdtcategories WHERE category_ID = #FORM.category_ID# </cfquery> <cfif qGetCat1.RecordCount NEQ 0> <strong>Current selection:</strong> <cfoutput>#qGetCat1.category_Name#</cfoutput> > </cfif> </cfif> <cfif isdefined ("FORM.scndctgry_ID")> <cfquery name="qGetCat2" datasource="#request.dsn#"> SELECT * FROM prdtscndcats WHERE scndctgry_ID = #FORM.scndctgry_ID# </cfquery> <cfif qGetCat2.RecordCount NEQ 0> <cfoutput>#qGetCat2.scndctgry_Name#</cfoutput> > </cfif> </cfif> <cfif isdefined ("FORM.thrdctgry_ID")> <cfquery name="qGetCat3" datasource="#request.dsn#"> SELECT * FROM prdtthrdcats WHERE thrdctgry_ID = #FORM.thrdctgry_ID# </cfquery> <cfif qGetCat2.RecordCount NEQ 0> <cfoutput>#qGetCat3.thrdctgry_Name#</cfoutput> <cfoutput>#qGetCat3.thrdctgry_ID#</cfoutput> </cfif> </cfif> <br /><br /> </cfform> <cfif isdefined ("FORM.action") AND FORM.action EQ "DisplayProducts"> <cfform name="UpdateProducts" method="POST" action="#Request.ThisPageQS#"> <cfif qGetProducts.RecordCount NEQ 0> <strong>Here is a list of all the ranges you have added to the site.<br> Tick the ones you would like added to the current category and click Submit. <cfoutput query="qGetProducts"></cfoutput></strong><cfoutput query="qGetProducts"> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="334" nowrap>#product_Name#</td> <td width="28"> <input name="Product_ID" type="checkbox" value="#product_ID#" <cfif isdefined ("SelectedProducts") AND ListFind(SelectedProducts, Product_ID)> checked="checked" </cfif>> </td> <td width="136" nowrap> <cfset RelatedProduct = ListContains(ProductList, product_ID)> <cfif RelatedProduct EQ 0> Range not in a category! <cfelse> </cfif> </td> </tr> </table> </cfoutput> <input name="thrdctgry_ID" type="hidden" value="<cfoutput>#FORM.thrdctgry_ID#</cfoutput>"> <input name="action" type="hidden" value="UpdateProducts"> <input name="Go2" type="submit" value="Submit"> </cfif> </cfform> </cfif> </div> </body> </html> Code (markup): Thanks for help.
1.) Make sure Sandbox is enabled as you don't have your USERNAME or PASSWORD set in your <cfquery> 2.) I noticed you are using REQUEST. I would try to set your variables in the App.cfc file. This is how I do it. <cfset application.datasource = StructNew() > <cfset application.datasource.datasource = "datasource"> <cfset application.datasource.username = "username"> <cfset application.datasource.password = "password"> The username and password are tied into your database... eg.) what you would use to login to access your database via.) MySQL or whatever. If you do not know your username or password contact your host, but you should know it Another thing I found odd was you used cfform and then you used regular HTML for the form. That makes no sense what so ever to me. Well I hope I helped you at least a fraction. Take care.