Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong with this?

Status
Not open for further replies.

Jerkycold

IS-IT--Management
Jun 17, 2003
26
US
I cannot figure out what is wrong with this code:


<cfquery
datasource=&quot;#peregrine#&quot;
name=&quot;getdomains&quot;>

<!--- select DISTINCT domain
FROM applicationorders --->
SELECT DISTINCTROW applicationorders.Domain, applicationorders.userid
FROM applicationorders
where applicationorders.userid = #session.userid#
GROUP BY applicationorders.Domain, applicationorders.userid
</cfquery>


<cfelse>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getdomains&quot;>

select DISTINCT domain
FROM applicationorders
</cfquery>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getusers&quot;>
SELECT DISTINCT applicationorders.userid, users.UserLastName, users.UserFirstName
FROM applicationorders LEFT JOIN users ON applicationorders.userid = users.UserID
WHERE ((Not (applicationorders.userid)=0))
order by users.userlastname, users.userfirstname
</cfquery>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getstates&quot;>

select *
from states

</cfquery>

</cfif>


<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getstatus&quot;>

select *
FROM applicationstatus
order by statusid

</cfquery>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getat&quot;>

select *
FROM applicationtypes

</cfquery>


<!--- ##### start content ##### --->



<!--- top part of tab --->
<b class=&quot;header&quot;>Generate Report</b><br>

<!--- top part of tab --->

<form action=&quot;appn-report.cfm&quot; method=&quot;post&quot;>
<input type=Hidden name=&quot;flag&quot; value=&quot;1&quot;>
<table border=0 cellpadding=4 cellspacing=0 width=100%>

<tr>
<td class=smallbold align=&quot;right&quot;>Domain</td>
<td class=small>
<select name=&quot;domain&quot;>
<option value=&quot;&quot;>--- All Domains ---
<cfoutput query=&quot;getdomains&quot;>
<option value=&quot;#domain#&quot;>#domain#
</cfoutput>
</select>
</td>
</tr>



<tr>
<td class=smallbold align=&quot;right&quot;>Agent</td>
<td class=small>
<select name=&quot;userid1&quot;>
<option value=&quot;&quot;>--- All Agents ---
<cfoutput query=&quot;getusers&quot;>
<option value=&quot;#userid#&quot;>#userlastname#, #userfirstname#
</cfoutput>
</select>
</td>
</tr>

<tr >
<td class=&quot;smallbold&quot; align=right>State</td>
<td class=&quot;small&quot;>
<select name=&quot;state&quot;>
<option value=&quot;&quot;>--- All ---
<cfoutput query=&quot;getstates&quot;>
<option value=&quot;#state#&quot;>#state#
</cfoutput>
</select>
</td>
</tr>

</cfif>
<tr>
<td class=smallbold align=&quot;right&quot;>Time Frame</td>
<td class=small>
<select name=&quot;timeframe&quot;>
<option value=&quot;&quot;>--- All ---
<option value=&quot;TD&quot;>today
<option value=&quot;LW&quot;>last 7 days
<option value=&quot;CM&quot;>current month
<option value=&quot;LM&quot;>last month
<option value=&quot;CY&quot;>current year
<option value=&quot;LY&quot;>last year
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>Type</td>
<td class=small>
<select name=&quot;applicationtypeid&quot;>
<option value=&quot;&quot;>--- All Types ---
<cfoutput query=&quot;getat&quot;>
<option value=&quot;#applicationtypeid#&quot;>#applicationtype#
</cfoutput>
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>VVC Status</td>
<td class=small>
<select name=&quot;vvcstatusid&quot;>
<option value=&quot;&quot;>--- All Status ---
<cfoutput query=&quot;getvvcstatus&quot;>
<option value=&quot;#vvcstatusid#&quot;>#vvcstatus#
</cfoutput>
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>Status</td>
<td class=small>
<select name=&quot;statusid&quot;>
<option value=&quot;&quot;>--- All Status ---
<cfoutput query=&quot;getstatus&quot;>
<option value=&quot;#statusid#&quot;>#status#
</cfoutput>
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>Credit</td>
<td class=small>
<select name=&quot;ratecredit&quot;>
<option value=&quot;&quot;>--- All ---
<option value=&quot;Good&quot;>Good
<option value=&quot;Fair&quot;>Fair
<option value=&quot;Poor&quot;>Poor
</select>
</td>
</tr>


<tr>
<td class=smallbold align=&quot;right&quot;>From (m/d/yy)</td>
<td class=small>
<input type=&quot;text&quot; name=&quot;from&quot; size=10 value=&quot;&quot;>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>To (m/d/yy)</td>
<td class=small>
<input type=&quot;text&quot; name=&quot;to&quot; size=10 value=&quot;&quot;>
</td>
</tr>


<tr>
<td class=smallbold align=&quot;center&quot;>&nbsp;</td>
<td class=smallbold>
<input type=&quot;submit&quot; value=&quot;Generate Report&quot;>
</td>
</tr>

</table>
</form>

<p>


Everytime I try to view it in my browser i get this error:

Error Diagnostic Information
Template file not found.



HTTP/1.0 404 Object Not Found
Note: If you wish to use an absolute template path (e.g. TEMPLATE=&quot;/mypath/index.cfm&quot;) with CFINCLUDE then you must create a mapping for the path using the ColdFusion Administrator.

Using relative paths (e.g. TEMPLATE=&quot;index.cfm&quot; or TEMPLATE=&quot;../index.cfm&quot;) does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible.


The error occurred while processing an element with a general identifier of (CFINCLUDE), occupying document position (4:1) to (4:56).


Date/Time: 07/09/03 14:31:33
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Remote Address: 192.168.254.48
Template: C:\Inetpub\

The funny thing is I have no cfinclude in this code!!!
 
The &quot;occupying document position (4:1) to (4:56)&quot; is the clue.

Position (4:1) to (4:56) means it's finding the problem between the first and fifty-sixth character of line 4.

I'm guessing you didn't include line 4 in the code above... because you started in the middle of a
Code:
<CFIF>
block.

Show us the very beginning of the file (lines 1 through 10, at most), and it will be more helpful.


-Carl
 
here is everything starting from line one, sorry about that:

<cfif session.usertypeid is not &quot;0&quot;> This is line 1

<cfquery
datasource=&quot;#peregrine#&quot; This is line 4
name=&quot;getdomains&quot;>

<!--- select DISTINCT domain
FROM applicationorders --->
SELECT DISTINCTROW applicationorders.Domain, applicationorders.userid
FROM applicationorders
where applicationorders.userid = #session.userid#
GROUP BY applicationorders.Domain, applicationorders.userid
</cfquery>


<cfelse>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getdomains&quot;>

select DISTINCT domain
FROM applicationorders
</cfquery>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getusers&quot;>
SELECT DISTINCT applicationorders.userid, users.UserLastName, users.UserFirstName
FROM applicationorders LEFT JOIN users ON applicationorders.userid = users.UserID
WHERE ((Not (applicationorders.userid)=0))
order by users.userlastname, users.userfirstname
</cfquery>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getstates&quot;>

select *
from states

</cfquery>

</cfif>


<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getstatus&quot;>

select *
FROM applicationstatus
order by statusid

</cfquery>

<cfquery
datasource=&quot;peregrine&quot;
name=&quot;getat&quot;>

select *
FROM applicationtypes

</cfquery>


<!--- ##### start content ##### --->



<!--- top part of tab --->
<b class=&quot;header&quot;>Generate Report</b><br>

<!--- top part of tab --->

<form action=&quot;appn-report.cfm&quot; method=&quot;post&quot;>
<input type=Hidden name=&quot;flag&quot; value=&quot;1&quot;>
<table border=0 cellpadding=4 cellspacing=0 width=100%>

<tr>
<td class=smallbold align=&quot;right&quot;>Domain</td>
<td class=small>
<select name=&quot;domain&quot;>
<option value=&quot;&quot;>--- All Domains ---
<cfoutput query=&quot;getdomains&quot;>
<option value=&quot;#domain#&quot;>#domain#
</cfoutput>
</select>
</td>
</tr>



<tr>
<td class=smallbold align=&quot;right&quot;>Agent</td>
<td class=small>
<select name=&quot;userid1&quot;>
<option value=&quot;&quot;>--- All Agents ---
<cfoutput query=&quot;getusers&quot;>
<option value=&quot;#userid#&quot;>#userlastname#, #userfirstname#
</cfoutput>
</select>
</td>
</tr>

<tr >
<td class=&quot;smallbold&quot; align=right>State</td>
<td class=&quot;small&quot;>
<select name=&quot;state&quot;>
<option value=&quot;&quot;>--- All ---
<cfoutput query=&quot;getstates&quot;>
<option value=&quot;#state#&quot;>#state#
</cfoutput>
</select>
</td>
</tr>

</cfif>
<tr>
<td class=smallbold align=&quot;right&quot;>Time Frame</td>
<td class=small>
<select name=&quot;timeframe&quot;>
<option value=&quot;&quot;>--- All ---
<option value=&quot;TD&quot;>today
<option value=&quot;LW&quot;>last 7 days
<option value=&quot;CM&quot;>current month
<option value=&quot;LM&quot;>last month
<option value=&quot;CY&quot;>current year
<option value=&quot;LY&quot;>last year
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>Type</td>
<td class=small>
<select name=&quot;applicationtypeid&quot;>
<option value=&quot;&quot;>--- All Types ---
<cfoutput query=&quot;getat&quot;>
<option value=&quot;#applicationtypeid#&quot;>#applicationtype#
</cfoutput>
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>VVC Status</td>
<td class=small>
<select name=&quot;vvcstatusid&quot;>
<option value=&quot;&quot;>--- All Status ---
<cfoutput query=&quot;getvvcstatus&quot;>
<option value=&quot;#vvcstatusid#&quot;>#vvcstatus#
</cfoutput>
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>Status</td>
<td class=small>
<select name=&quot;statusid&quot;>
<option value=&quot;&quot;>--- All Status ---
<cfoutput query=&quot;getstatus&quot;>
<option value=&quot;#statusid#&quot;>#status#
</cfoutput>
</select>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>Credit</td>
<td class=small>
<select name=&quot;ratecredit&quot;>
<option value=&quot;&quot;>--- All ---
<option value=&quot;Good&quot;>Good
<option value=&quot;Fair&quot;>Fair
<option value=&quot;Poor&quot;>Poor
</select>
</td>
</tr>


<tr>
<td class=smallbold align=&quot;right&quot;>From (m/d/yy)</td>
<td class=small>
<input type=&quot;text&quot; name=&quot;from&quot; size=10 value=&quot;&quot;>
</td>
</tr>

<tr>
<td class=smallbold align=&quot;right&quot;>To (m/d/yy)</td>
<td class=small>
<input type=&quot;text&quot; name=&quot;to&quot; size=10 value=&quot;&quot;>
</td>
</tr>


<tr>
<td class=smallbold align=&quot;center&quot;> </td>
<td class=smallbold>
<input type=&quot;submit&quot; value=&quot;Generate Report&quot;>
</td>
</tr>

</table>
</form>

<p>


 
Yes, you do. Otherwise you'd have no CFAPPLICATION tag, and
Code:
session.usertypeid
(from line 1) as well as you're entire session scope would not exist.

Of course... this could be the root of the error. Though usually you get something a lot more meaningful, like &quot;no variable called 'USERTYPEID' is available in the scope: SESSION... use CFAPPLICATION to activate sessionmanagement...&quot;

But... CF might just be thoroughly confused.



-Carl
 
line 4: datasource=&quot;#peregrine#&quot;
other queries: datasource=&quot;peregrine&quot;

Is the first reference (line 4) to a variable &quot;peregrine&quot;?

 
DOH! Completely missed that.
rlarson's right... and that's probably what's throwing the error right there.


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top