I have been staring at this for hours, and simplified the code to the essence of the problem. I basically run a query which works fine when there the recordcount is not 0. Although, if there are no records found, the page comes up blank... rather than "The recordcount is 0!" I would greatly appreciate any assistance.
<cfquery name="OldUserName" datasource="Teak" dbtype="ODBC">
SELECT SCPid, UserName
FROM tblSalesCommissionPayees
WHERE Username='#Form.UserNameAdd#'
</cfquery>
<cfoutput query="OldUserName">
<cfif #oldusername.RecordCount# eq 1>
The Recordcount is 1!
<cfelse>
The recordcount is 0!
</cfif>
</cfoutput>
<cfquery name="OldUserName" datasource="Teak" dbtype="ODBC">
SELECT SCPid, UserName
FROM tblSalesCommissionPayees
WHERE Username='#Form.UserNameAdd#'
</cfquery>
<cfoutput query="OldUserName">
<cfif #oldusername.RecordCount# eq 1>
The Recordcount is 1!
<cfelse>
The recordcount is 0!
</cfif>
</cfoutput>