troubleshooting Question

Integrity constraint violation

Avatar of tatortot
tatortot asked on
Web Servers
2 Comments1 Solution315 ViewsLast Modified:
When I test this page on my local machine, it works fine. After uploading (including the database) - I get the following error after trying to insert a new record:

-----------error message--------------
ODBC Error Code = 23000 (Integrity constraint violation)

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'AddonID', table 'eldb.dbo.OrderAddons'; column does not allow nulls. INSERT fails.
-----------/error message--------------

I have the AddonID specified in a dropdown menu so it should not be passing a NULL value (and it doesn't on my local machine).

The only difference between my local machine & hosting company is that I'm using Coldfusion MX and they are using Coldfusion 4.5

Also, here is the code for the dropdown menu:

<cfquery name="Addons" datasource="eldb">
SELECT * FROM dbo.AvailableAddons
left join OrderAddons on OrderAddons.AddonID = AvailableAddons.AddonID
</cfquery>
-------------------
<select name="AddonID" class="formareasinput">
         <cfoutput query="Addons">
          <option value="#Addons.AddonID#">#Addons.AddonName#</option>
         </cfoutput>
        </select>


Any ideas?


ASKER CERTIFIED SOLUTION
JimV_ATL

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros