I can't actually run this code again until Tuesday as I am off till
then!

The error I get is an SQL error which will be because of the dataType of
the field I am testing it with, the field is text but the value I am
testing it with is numeric so the first try at the query will assume it
is a numeric field and not use quotes, when this fails it is supposed to
assume it is a text field and try it with quotes.

I have not tried it with type = "database" but I thought that any should
catch any.

I do not think that it is a problem with the cfinclude as the code works
fine when I try it with a numeric or text field that looks like a
numeric or text field (i.e. text is not numeric and numeric is numeric)
it only fails with a text field that is numeric.

Anyway, as I said I can't do anything with this till Tuesday but I'll
try these suggestions then.

Thanks for the help.


Giles Roadnight
http://giles.roadnight.name


-----Original Message-----
From: Russ 'Snake' Michaels [mailto:[EMAIL PROTECTED]] 
Sent: 12 September 2002 15:37
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] CFTRY

there may be an issue with an error occuring inside an included file
between
the catch block. Try inserting the code directly and not including it
see if
it works.

-----Original Message-----
From: Giles Roadnight [mailto:[EMAIL PROTECTED]]
Sent: 12 September 2002 15:34
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] CFTRY


Hi, I've not used CFTRY before but I can't see why this doesn't work:

  <cftry>
   <cfinclude template="qry_getSearches.cfm">
   <cfcatch type="any">
    <cfset request.fieldIsNumeric = false>
    <cfinclude template="qry_getSearches.cfm">
   </cfcatch>
  </cftry>

I expect the qry_getSearches.cfm to fail sometimes as I am guessing on
of
the datatypes in the query. The way I want it to work is if the query
fails
the field can't be numeric and needs ' ' s around the field value. To do
this I set the variable to false and re-run the query, this then adds
the '
' s. However, I get an error from the first query even though it is in a
cftry (this cftry is in a nother cftry btw) I know I am getting the
error
from the first query as I still get it if I comment the second one out.

Thanks for your help

Giles


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to