I know that most of you all know this already, but I figured it was worth a blog post since I just saw this from http://www.autosite.com. I got this very informative error message back when using their site earlier. . .
Query Of Queries runtime error.
Expected type STRING but encountered type NULL on the left of the LIKE condition
The error occurred in D:\INETPUB\wwwroot\content\Research\kbb\act_valueReport.cfm: line 74
Called from D:\INETPUB\WWWROOT\content\Research\kbb\index.cfm: line 21
72 :
73 : <cfmodule template="mod_kbbtable.cfm" width="#kbbModTableWidth#">
74 : <cfquery dbtype="query" name="qEquip">
75 : SELECT * FROM valueReport.Equipments WHERE GroupCode LIKE 'M' ORDER BY DisplayOrder
76 : </cfquery>
While it is important for us as developers to log this type of information, there is NO reason for us to show it to our customers. Now I know table names, physical paths, and other good stuff. In your asp.net applicaitons make sure you set your customer errors to “On” (http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx). You also want to make sure that you have logging so that you as the developer can triage errors.
Oh and here is a BONUS TIP: Don’t use Select *, in most cases you don’t need all the columns and there is no reason to have the DB send them all back. . . .
Let’s start a campaign to call out any website that we see on the internet that doesn’t properly hide their dirty laundry.