I am experiencing a similar problem as reported by MSOM, although this error
suddenly began occurring after never seeing it before for several years. The
error that was being reported by CFMX (our version number is 6,1,0,hf56421_61)
is: Error Executing Database Query. [Macromedia][SQLServer JDBC
Driver][SQLServer]Could not find prepared statement with handle 0. The error
occurred on line 75. Line 75 corresponds to the following cfqueryparam
statement found in the attached query: - where nodeid = <cfqueryparam
value='#attributes.levelguid#' cfsqltype='cf_sql_idstamp'> Now, I have read
that this issue can be resolved by removing queryparams from cfquery tags.
That seems like a bit of a knee- reaction, though, considering that in this
case this template has not been modified for several years, and we just
recently started seeing these errors. Has anyone (including Macromedia
Support) found a root cause to this error? If not, does a list of scenarios
exist that explain why this error may occur (given each scenario)? Lastly,
could this be an issue with the jdbc driver that ships with CFMX? Thank you in
advance for your help. Please let me know if you need more information. Best
Wishes and Regards, Abraham Lloyd [email]abrahamonproject.com[/email] ---- Begin Code ----
:confused;

<cfquery name="request.get_parents" datasource="#request.dsn#">

select case ntm_content_type
when 'hb_corporate' then 'Corporate'
when 'hb_corporategroup' then (select GrpName from hb_corporategroup where
GrpId = NodeID)
when 'hb_region' then (select RegName from hb_region where RegId = NodeID)
when 'hb_division' then (select DivName from hb_division where DivId =
NodeID)
when 'hb_community' then (select CommName + '-' +
convert(varchar(10),commno) commname from hb_community where CommId = NodeID)
when 'hb_communitylotblock' then (select convert(varchar(10), LotBlock)
from hb_CommunityLotBlock where CommLBID = NodeID and IsDeleted = 0)
end NodeName,
ntm_content_type,
ntmLevel,
nodeID,
manageFuseaction = case ntm_content_type
when 'hb_corporate' then 'manageCorporateGroup'
when 'hb_corporategroup' then 'manageRegion'
when 'hb_region' then 'manageDivision'
when 'hb_division' then 'manageCommunity'
when 'hb_community' then 'manageCommunityLotBlock'
end
from hb_ntm
where nleft < <cfqueryparam value="#attributes.nleft#"
cfsqltype="cf_sql_integer"> and
nright > <cfqueryparam value="#attributes.nright#"
cfsqltype="cf_sql_integer">

union

select case ntm_content_type
when 'hb_corporate' then 'Corporate'
when 'hb_corporategroup' then (select GrpName from hb_corporategroup where
GrpId = NodeID)
when 'hb_region' then (select RegName from hb_region where RegId = NodeID)
when 'hb_division' then (select DivName from hb_division where DivId =
NodeID)
when 'hb_community' then (select CommName + '-' +
convert(varchar(10),commno) commname from hb_community where CommId = NodeID)
when 'hb_communitylotblock' then (select convert(varchar(10), LotBlock)
from hb_CommunityLotBlock where CommLBID = NodeID and IsDeleted = 0)
end NodeName,
ntm_content_type,
ntmLevel,
nodeID,
manageFuseaction = case ntm_content_type
when 'hb_corporate' then 'manageCorporateGroup'
when 'hb_corporategroup' then 'manageRegion'
when 'hb_region' then 'manageDivision'
when 'hb_division' then 'manageCommunity'
when 'hb_community' then 'manageCommunityLotBlock'
end
from hb_ntm
where nodeid = <cfqueryparam value="#attributes.levelguid#"
cfsqltype="cf_sql_idstamp">

order
by ntmlevel

</cfquery>