<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Web Wiz Support and Community Forums : Error: The query has been canceled because</title>
  <link>https://forums.webwiz.net/</link>
  <description><![CDATA[This is an XML content feed of; Web Wiz Support and Community Forums : Web Wiz Forums : Error: The query has been canceled because]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 07 Apr 2026 09:43:21 +0000</pubDate>
  <lastBuildDate>Thu, 05 Jul 2007 11:41:16 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.08</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://forums.webwiz.net/RSS_post_feed.asp?TID=23675</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Web Wiz Support and Community Forums]]></title>
   <url>https://forums.webwiz.net/forum_images/web_wiz_forums.png</url>
   <link>https://forums.webwiz.net/</link>
  </image>
  <item>
   <title><![CDATA[Error: The query has been canceled because : Not sure why it wasn&amp;#039;t like...]]></title>
   <link>https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124339.html#124339</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=1">WebWiz-Bruce</a><br /><strong>Subject:</strong> 23675<br /><strong>Posted:</strong> 05&nbsp;July&nbsp;2007 at 11:41am<br /><br />Not sure why it wasn't like that in the first place, seems stupid returning all the records then using a client side recordset move, when all we need is the 1 record.]]>
   </description>
   <pubDate>Thu, 05 Jul 2007 11:41:16 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124339.html#124339</guid>
  </item> 
  <item>
   <title><![CDATA[Error: The query has been canceled because : Yes, this seems like a better...]]></title>
   <link>https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124338.html#124338</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=22795">Cem Alacayir</a><br /><strong>Subject:</strong> 23675<br /><strong>Posted:</strong> 05&nbsp;July&nbsp;2007 at 11:30am<br /><br />Yes, this seems like a better version.<DIV>&nbsp;</DIV><DIV>I don't know why but it seems "ORDER BY Thread.Message_date" costs too much in SQL Server for some reason but using strDBTop1 should improve it.</DIV><DIV>&nbsp;</DIV><DIV>Thanks Borg.</DIV>]]>
   </description>
   <pubDate>Thu, 05 Jul 2007 11:30:09 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124338.html#124338</guid>
  </item> 
  <item>
   <title><![CDATA[Error: The query has been canceled because : The following should have the...]]></title>
   <link>https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124335.html#124335</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=1">WebWiz-Bruce</a><br /><strong>Subject:</strong> 23675<br /><strong>Posted:</strong> 05&nbsp;July&nbsp;2007 at 9:12am<br /><br />The following should have the same type of performance improvement, but will ensure compatibility with all databases types used:-<br><br><table width="99%"><tr><td><pre class="BBcode">strSQL = "SELECT " &amp; strDBTop1 &amp; " " &amp; strDbTable &amp; "Thread.Thread_ID " &amp; _<br>&nbsp;&nbsp;&nbsp; "FROM " &amp; strDbTable &amp; "Thread" &amp; strDBNoLock &amp; " " &amp; _<br>&nbsp;&nbsp;&nbsp; "WHERE " &amp; strDbTable &amp; "Thread.Topic_ID = "&nbsp; &amp; lngTopicID &amp; " " &amp; _<br>&nbsp;&nbsp;&nbsp; "ORDER BY " &amp; strDbTable &amp; "Thread.Message_date ASC " &amp; strDBLimit1 &amp; ";"</pre></td></tr></table><br>]]>
   </description>
   <pubDate>Thu, 05 Jul 2007 09:12:26 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124335.html#124335</guid>
  </item> 
  <item>
   <title><![CDATA[Error: The query has been canceled because : I think this page got missed in...]]></title>
   <link>https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124334.html#124334</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=1">WebWiz-Bruce</a><br /><strong>Subject:</strong> 23675<br /><strong>Posted:</strong> 05&nbsp;July&nbsp;2007 at 9:07am<br /><br />I think this page got missed in the last optimisation audit, but will certainly look at improving it.<br><br>I have a feeling though that for mySQL the MAX method is a bit buggy when you include a WHERE clause.<br>]]>
   </description>
   <pubDate>Thu, 05 Jul 2007 09:07:17 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124334.html#124334</guid>
  </item> 
  <item>
   <title><![CDATA[Error: The query has been canceled because :   Microsoft OLE DB Provider...]]></title>
   <link>https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124324.html#124324</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=22795">Cem Alacayir</a><br /><strong>Subject:</strong> 23675<br /><strong>Posted:</strong> 04&nbsp;July&nbsp;2007 at 9:15pm<br /><br /><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>Microsoft OLE DB Provider for SQL Server error '80040e14' </DIV><DIV>The query has been canceled because the estimated cost </DIV><DIV>of this query (432) exceeds the configured threshold of 60. </DIV><DIV>Contact the system administrator.</DIV><DIV></pre></td></tr></table><BR></DIV><DIV>&nbsp;</DIV><DIV>I started to get the above error whenever I deleted a single&nbsp;post from a topic. The post was really deleted but the error was causing topic records to be orphaned thus the topics were disappearing from the forums. I found out&nbsp;that&nbsp;the delete query was successfull but another query just before the query that updates topic statistics was stopping the execution in <strong>delete_post.asp</strong>.</DIV><DIV>&nbsp;</DIV><DIV>The query that was failing is</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>&nbsp;'Check there are other Posts for the Topic, if not delete the topic as well&nbsp;<BR>&nbsp;'Initalise the strSQL variable with an SQL statement to get the Threads from the database<BR>&nbsp;strSQL = "SELECT " &amp; strDbTable &amp; "Thread.Thread_ID " &amp; _<BR>&nbsp;"FROM " &amp; strDbTable &amp; "Thread" &amp; strDBNoLock &amp; " " &amp; _<BR>&nbsp;"WHERE " &amp; strDbTable &amp; "Thread.Topic_ID = "&nbsp; &amp; lngTopicID &amp; " " &amp; _<BR>&nbsp;"ORDER BY " &amp; strDbTable &amp; "Thread.Message_date ASC;"<BR>&nbsp;<BR>&nbsp;'Query the database<BR>&nbsp;rsCommon.Open strSQL, adoCon<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;'If there are posts left in the database for this topic get some details for them<BR>&nbsp;If NOT rsCommon.EOF Then<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;'Move to the last message in the topic to get the details of the last post<BR>&nbsp;&nbsp;rsCommon.MoveLast<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;'Get the post ID of the last post<BR>&nbsp;&nbsp;lngLastPostID = CLng(rsCommon("Thread_ID"))<BR>&nbsp;End If<BR>&nbsp;<BR>&nbsp;'Close the recordset<BR>&nbsp;rsCommon.Close<BR></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>It seems strange to me that a simple task like finding the last post id of the thread is determined with an&nbsp;inefficient&nbsp;code like this which costs too much in SQL Server. So I changed the code to a better version:</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>&nbsp;strSQL = "SELECT MAX(" &amp; strDbTable &amp; "Thread.Thread_ID)" &amp; _<BR>&nbsp;"FROM " &amp; strDbTable &amp; "Thread"&nbsp; &amp; strDBNoLock &amp; " " &amp; _<BR>&nbsp;"WHERE " &amp; strDbTable &amp; "Thread.Topic_ID = "&nbsp; &amp; lngTopicID<BR>&nbsp;rsCommon.Open strSQL, adoCon<BR>&nbsp;If NOT rsCommon.EOF Then<BR>&nbsp;&nbsp;If (rsCommon(0) &lt;&gt; "") Then lngLastPostID = CLng(rsCommon(0))<BR>&nbsp;End If<BR>&nbsp;rsCommon.Close<BR></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>I hope Borg optimizes queries like this in version 9.0.</DIV><span style="font-size:10px"><br /><br />Edited by Cem Alacayir - 04&nbsp;July&nbsp;2007 at 9:17pm</span>]]>
   </description>
   <pubDate>Wed, 04 Jul 2007 21:15:16 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/error-the-query-has-been-canceled-because_topic23675_post124324.html#124324</guid>
  </item> 
 </channel>
</rss>