
Event-triggered DTS Packages?
Quote:
>Has anyone come across a means of triggering the execution of a DTS package
>based on an event (e.g., a file appearing in a particular directory) as
>opposed to a set schedule or "monitoring/polling" program running
>periodically?
>Chris
There are some API calls that can be used to "watch" a directory.
Declare Function FindFirstChangeNotification Lib "kernel32" _
Alias "FindFirstChangeNotificationA" _
(ByVal lpPathName As String, _
ByVal bWatchSubtree As Long, _
ByVal dwNotifyFilter As Long) As Long
Declare Function FindCloseChangeNotification Lib "kernel32" _
(ByVal hChangeHandle As Long) As Long
Declare Function FindNextChangeNotification Lib "kernel32" _
(ByVal hChangeHandle As Long) As Long
Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
I'm sure my sample came from http://www.mvps.org/vbnet/ or
http://www.mvps.org/vb/
It might be better to make the process that creates the file send some
other notification to start the package.
--
Darren Green
SQL/DTS - http://www.swynk.com/friends/green/