Doing the folowing i get the logto MydirWatcher, but nothing in the DB.

<cfcomponent>
<cffunction access="public" name="onChange" output="no" returntype="query">
 <cfargument name="CFEvent" type="struct" required="yes">
 <cfset var qryInsertTest = "">
    <cfset data=CFEvent.data>
 <cftry>
      <cfquery name="qryInsertTest" datasource="#DSN#">
         INSERT INTO [eventlist] ([Updated])
         VALUES (<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
value="#dateformat(data.lastmodified)#" null="No">)
      </cfquery>
        <cfcatch type="database">
            <cfset success = 'false' />
        </cfcatch>
 </cftry>
    <cflog file="MydirWatcher" application="No"
            text=" ACTION: #data.type#;FILE: #data.filename#;
            TIME: #timeFormat(data.lastmodified)#">
</cffunction>
</cfcomponent>

But if this is going to run int he background as a CFC then how would i ever
see the error?


This is my first foray into Directory Watcher...


On 8/26/07, AJ Mercer <[EMAIL PROTECTED]> wrote:
>
> is DSN being set
>
> I do not see a open cftry
>
> does the query throw an error?
>
>
> On 8/26/07, Richard Dillman <[EMAIL PROTECTED]> wrote:
> >
> > Its almost 3 am and Maybe that's the problem,
> >
> > I seem to have no problem getting Directory Watcher to work in the
> admin,
> > and logging the information into with CFLog,
> > but what I cannot do is log the information to the database with a
> Query.
> > What am i forgetting here?
> >
> > <cfcomponent>
> > <cffunction access="public" name="onChange" output="no"
> > returntype="query">
> >     <cfargument name="CFEvent" type="struct" required="yes">
> >     <cfset data=CFEvent.data>
> >       <cfquery name="qryInsertTest" datasource="#DSN#">
> >          SET NOCOUNT ON
> >          INSERT INTO [eventlist] ([Updated])
> >          VALUES (<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
> > value="#dateformat(data.lastmodified)#" null="No">)
> >       </cfquery>
> > </cftry>
> >     <cflog file="MydirWatcher" application="No"
> >             text=" ACTION: #data.type#;FILE: #data.filename#;
> >             TIME: #timeFormat(data.lastmodified)#">
> > </cffunction>
> > </cfcomponent>
> >
> > Their is only one file that will be updated via FTP, so I guess the next
> > question is, Can I have Directory Watcher watch only one file?
> >
> >
> > --
> > --
> > Richard Dillman
> > [EMAIL PROTECTED]
> > (317) 916-8341
> >
> > "I will always give you what you ask for, its just not usually what you
> > want"
> >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287140
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to