Hi everyone. I have an edit page that updates some fields in a database. We just converted everything from Access to SQL. I can update the page just fine for the most part, except when I try to update the Sales Order Number for some reason. I'm not sure why. I think it has something to do with the SQL database, but I don't know what. The field is called Sales_Order_Number. When I try to enter a number in this field, I get a 500 Internal Server error. Below is my query that I use to display the info. on the action page, and also the Updating of the table.
We have also updated our ColdFusion from MX7 to 11. Not sure if that would make a difference or not otherwise. Can someone please help? Thanks.
Andy
<CFQUERY NAME="ShowContact" Datasource="#application.DataSource#">
SELECT Company, Company_Name, First_Name, Middle, Last_Name,
ContactID, Contact_Num, ItemID, Item_Num, RFQID, RFQID_SPEC, Entry_Date
FROM
(((Contacts LEFT JOIN RFQ_Numbers ON Contacts.ContactID = RFQ_Numbers.Contact_Num)
LEFT JOIN Companies ON Contacts.Company = Companies.Company_Name)
LEFT JOIN RFQ_SPEC ON RFQ_Numbers.RFQID = RFQ_SPEC.RFQID_SPEC)
Where ItemID=#form.ItemID#
<!--- And Contacts.RFQ_Num >=0 --->
ORDER BY ItemID
</CFQUERY>
<cfset Form.RFQ_Expected_Value = ReReplace(Form.RFQ_Expected_Value,"[$,abcdefghijklmnopqrstuvwxyz]","","All")>
<cfquery Datasource="#application.DataSource#">
Update RFQ_SPEC
Set <!--- <cfif Entry_Date IS "">Entry_Date=Null,
<cfelse>Entry_Date='#form.Entry_Date#',</cfif> --->
M2M_Quote_Number= <cfif isDefined("form.M2M_Quote_Number") and #form.M2M_Quote_Number# neq
""> '#form.M2M_Quote_Number#',
<cfelse>
NULL,
</cfif>
Rev='#form.Rev#',
Standard_Part_Number='#form.Standard_Part_Number#',
Generic_Description='#form.Generic_Description#',
<!--- <CFIF IsDefined("form.GHz_Socket")>GHz_Socket =
#form.GHz_Socket#,</CFIF> --->
Received_By='#form.Received_By_Initials#',
Assigned_By='#form.Assigned_By_Initials#',
RFQ_Leader='#form.RFQ_Leader_Initials#',
Jsquad_Coordinator='#form.Jsquad_Initials#',
<cfif Complete_Date IS "">Complete_Date=Null,
<cfelse>Complete_Date='#form.Complete_Date#',</cfif>
Highest_Quantity_Request= <cfif isDefined("form.Highest_Quantity_Request") and
#form.Highest_Quantity_Request# neq
"">
'#form.Highest_Quantity_Request#',
<cfelse>
NULL,
</cfif>
<cfif New_Custom_PO_Received_Date IS "">New_Custom_PO_Received_Date=Null,
<cfelse>New_Custom_PO_Received_Date='#form.New_Custom_PO_Received_Date#',</cfif>
Sales_Order_Number= <cfif isDefined("form.Sales_Order_Number") and
#form.Sales_Order_Number# neq
""> '#form.Sales_Order_Number#',
<cfelse>
NULL,
</cfif>
<CFIF IsDefined("form.Order_Request")>Order_Request =
#form.Order_Request#,</CFIF>
Customer_Reason_Rejecting='#form.Customer_Reason_Rejecting#',
Budgetary_Quote='#form.Budgetary_Quote#',
RFQ_Expected_Value= <cfif isDefined("form.RFQ_Expected_Value") and #form.RFQ_Expected_Value# neq
""> '#form.RFQ_Expected_Value#',
<cfelse>
NULL,
</cfif>
Possible_Status='#form.Possible_Order#',
<!--- Code for if a Sales Order Number is entered, then the Sales Status field will be entered as "Ordered". If the Sales Order Number field is blank, then the Sales Status field will be entered as whatever the drop down menu item that was chosen.
--->
<cfif Sales_Order_Number IS Not "">Sales_Status="Ordered",
<cfelseif Sales_Order_Number IS "">Sales_Status='#form.Sales_Options#',
</cfif>
Additional_Comments='#form.Additional_Comments#',
End_Customer_Name='#form.End_Customer_Name#'
Where ItemID=#form.ItemID#
</cfquery>