Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL Server error '80040e14' Ambiguous column name
    text
    copied!<p>I have an admin page to search for products to edit, but the page keeps returning the error:</p> <blockquote> <p>Microsoft OLE DB Provider for SQL Server error '80040e14' Ambiguous column name 'prod_id'. /__admin/searchproducts.asp, line 89</p> </blockquote> <p>I'm unsure why this error is cropping up, because the page and site is a direct copy of another website and associated MSSQL database and the search product page works on that site.</p> <p>This is the code in question (not sure if it will be easy to read here though);</p> <pre><code>if request("fldSubmitted") &lt;&gt; "" then if request("fldprodid") &lt;&gt; "" and isNumeric(request("fldprodid")) then SQL = "select * from products where prod_id = " &amp; cdbl(request("fldprodid")) else SQL = "select " if request("showtop") &lt;&gt; "all" then SQL = SQL &amp; " top " &amp; request("showtop") &amp; " " &amp; replace(replace(request("orderby")," asc","")," desc","") &amp; ", " end if SQL = SQL &amp; "prod_name, prod_id, prod_code, prod_icon, prod_thumb, prod_numViews, prod_archived" if request("fldLabel") &lt;&gt; "" then SQL = SQl &amp; ", label_name" if request("fldCat") &lt;&gt; "" then SQL = SQL &amp; ", cat_name" if request("fldSubcat") &lt;&gt; "" then SQL = SQL &amp; ", subcat_name" SQL = SQL &amp; " from products" if request("fldLabel") &lt;&gt; "" then SQL = SQL &amp; ", labels" if request("fldCat") &lt;&gt; "" then SQL = SQL &amp; ", categories" if request("fldSubcat") &lt;&gt; "" then SQL = SQl &amp; ", subcategories" sql = sql &amp; " where 1=1" if request("fldLabel")&lt;&gt; "" then SQL = SQL &amp; "and prod_label = label_id " if request("fldCat") &lt;&gt; "" then SQL = SQL &amp; "and prod_category = cat_id " if request("fldSubcat") &lt;&gt; "" then SQL = SQL &amp; "and prod_subcategory = subcat_id " if request("fldName") &lt;&gt; "" then SQL = SQL &amp; " and (prod_name like '%" &amp; replace(request("fldName"),"'","''") &amp; "%')" if request("fldCode") &lt;&gt; "" then SQL = SQL &amp; " and (prod_code like '%" &amp; replace(request("fldCode"),"'","''") &amp; "%')" if request("fldLabel") &lt;&gt; "" then SQL = SQL &amp; " and prod_label = " &amp; request("fldLabel") if request("fldCat") &lt;&gt; "" then SQL = SQL &amp; " and prod_category = " &amp; request("fldCat") if request("fldSubcat") &lt;&gt; "" then SQL = SQL &amp; " and prod_subcategory = " &amp; request("fldSubcat") if request("fldArchived") = "No" then SQL = SQL &amp; " and prod_archived = 0" if request("instock") = "No" then SQL = SQL &amp; " and prod_numleft &gt; 0" end if SQL = SQL &amp; " order by " &amp; request("orderby") end if </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload