Using folder Agent to fire large MSAccess Job

Using folder Agent to fire large MSAccess Job

Post by Barry G. Sumpte » Fri, 18 Aug 2000 09:47:30



Hi all,
    I've just finished testing a scripting agent on my development stand
alone exchange server.  The script saves attachments and needs to join this
attachment file which has 60,000 records to a file which has 3,000 records.
The attachment extract works very quickly.  However the join code (open
files, read record, write record, read next record, etc..) was  running for
over an hour.  So I had to stop the events service.

   I've just created simple macros in MSAccess to do the same job.  The
MSAccess macros successfully run in 4 minutes.

   I'd like to Automate the firing of these MSAccess macros instead of using
the join code as described above.

   Is there a way to execute these MSAccess macros from my agent scripts?
   If so, how ?  And any example would be appreciated.

    Also, I see that the NEW AGENT dialog has an 'Other' tick box under the
Run the following action - frame.
    When I click the drop down arrow I see the 'Microsoft Routing Engine
Agent'.

    Does anyone know how to develop an agent like this?  I've had a look
around and can't seem to find the source code.

Thanks heaps everyone,
    Barry G. Sumpter

 
 
 

Using folder Agent to fire large MSAccess Job

Post by Jeremy Smit » Fri, 18 Aug 2000 04:00:00


Hi Barry,

Please see my replies inline below.



Quote:> Hi all,
>     I've just finished testing a scripting agent on my development stand
> alone exchange server.  The script saves attachments and needs to join
this
> attachment file which has 60,000 records to a file which has 3,000
records.
> The attachment extract works very quickly.  However the join code (open
> files, read record, write record, read next record, etc..) was  running
for
> over an hour.  So I had to stop the events service.

>    I've just created simple macros in MSAccess to do the same job.  The
> MSAccess macros successfully run in 4 minutes.

>    I'd like to Automate the firing of these MSAccess macros instead of
using
> the join code as described above.

>    Is there a way to execute these MSAccess macros from my agent scripts?
>    If so, how ?  And any example would be appreciated.

Keep in mind that the script code is being executed on the server, so if you
were to install MS Access on the server you could create an instance of
Access using the CreateObject call.  Once you have an Access object ready,
use its object model to load the attachment file from disk and merge the
records into the database of your choice.

Check out this URL to start becoming familiar with Access objects, their
methods and properties.
http://msdn.microsoft.com/library/default.asp?URL=/library/officedev/...
deovrmicrosoftaccess.htm  You may need to copy and paste the URL fragments
into your browser if your newsreader breaks the line wrapping.

Quote:>     Also, I see that the NEW AGENT dialog has an 'Other' tick box under
the
> Run the following action - frame.
>     When I click the drop down arrow I see the 'Microsoft Routing Engine
> Agent'.

>     Does anyone know how to develop an agent like this?  I've had a look
> around and can't seem to find the source code.

The Microsoft Routing Engine is a custom script handler written by Microsoft
that implments the IExchangeEventHandler interface.  Check out the
agents.hlp file for more information.
http://www.cdolive.com/download/agents.zip

Quote:> Thanks heaps everyone,
>     Barry G. Sumpter

Hope this enough to get you started!

-Jeremy

 
 
 

Using folder Agent to fire large MSAccess Job

Post by Barry G. Sumpte » Sat, 19 Aug 2000 08:18:24


Hi everyone and thanks for the response Jeremy.

I was very worried about this join taking so long.
Really, 60,000 records to join with 30,000 records, both being flat .csv
files, should be
lightening fast.  ie. no database load overheads etc...

Although there was a loop in my app to loop thru each record,  the code was
NOT stuck in a loop.
So I removed my debugging code which was writting to a log.txt file.
Still no help.

Then I removed the debugging code for DebugAppend for building the
Script.Response (for this section of code).

PROBLEM SOLVED: Now the entire script executes in less than 3 minutes.

Thanks for pointing me to the access objects - I am familiar with them since
I'm a vb programmer.

I was hoping someone would tell me NOT to use the overhead of msaccess on an
exchange server
which supports email for my company.  I suggested 6 months ago that we
should be running agents
on a seperate exchange server.  ie.  one that does not process email.

If I were to persue this then I would use the creatobject as you recommended
and then fire my standard MSAccess macro
and let msaccess do the rest.

Thanks for that.

Although its been a while I believe the agents.zip you're refering to is
just more vb scripting samples.
I was hoping for souce to the custom script handler written by Microsoft.
I want disect it and learn how to write my own.

Thanks again,
    Barry G. Sumpter


> Hi Barry,

> Please see my replies inline below.



> > Hi all,
> >     I've just finished testing a scripting agent on my development stand
> > alone exchange server.  The script saves attachments and needs to join
> this
> > attachment file which has 60,000 records to a file which has 3,000
> records.
> > The attachment extract works very quickly.  However the join code (open
> > files, read record, write record, read next record, etc..) was  running
> for
> > over an hour.  So I had to stop the events service.

> >    I've just created simple macros in MSAccess to do the same job.  The
> > MSAccess macros successfully run in 4 minutes.

> >    I'd like to Automate the firing of these MSAccess macros instead of
> using
> > the join code as described above.

> >    Is there a way to execute these MSAccess macros from my agent
scripts?
> >    If so, how ?  And any example would be appreciated.

> Keep in mind that the script code is being executed on the server, so if
you
> were to install MS Access on the server you could create an instance of
> Access using the CreateObject call.  Once you have an Access object ready,
> use its object model to load the attachment file from disk and merge the
> records into the database of your choice.

> Check out this URL to start becoming familiar with Access objects, their
> methods and properties.

http://msdn.microsoft.com/library/default.asp?URL=/library/officedev/...

- Show quoted text -

Quote:> deovrmicrosoftaccess.htm  You may need to copy and paste the URL fragments
> into your browser if your newsreader breaks the line wrapping.

> >     Also, I see that the NEW AGENT dialog has an 'Other' tick box under
> the
> > Run the following action - frame.
> >     When I click the drop down arrow I see the 'Microsoft Routing Engine
> > Agent'.

> >     Does anyone know how to develop an agent like this?  I've had a look
> > around and can't seem to find the source code.

> The Microsoft Routing Engine is a custom script handler written by
Microsoft
> that implments the IExchangeEventHandler interface.  Check out the
> agents.hlp file for more information.
> http://www.cdolive.com/download/agents.zip

> > Thanks heaps everyone,
> >     Barry G. Sumpter

> Hope this enough to get you started!

> -Jeremy

 
 
 

Using folder Agent to fire large MSAccess Job

Post by Siegfried Weber [MVP-Exchange » Sun, 20 Aug 2000 04:00:00


Barry,

Quote:> I was hoping for souce to the custom script handler written by Microsoft.
> I want disect it and learn how to write my own.

There you go:

http://support.microsoft.com/support/kb/articles/Q192/3/39.ASP

--
Siegfried Weber

Microsoft Most Valuable Professional (MVP) - Exchange Server
Co-author of "Professional CDO Programming", Wrox Press 1999

CDOLive - The Premier Resource for Microsoft Collaboration Data Objects
http://www.cdolive.com

Please reply to the newsgroups so that others can benefit from the
discussion.
Questions by e-mail are discarded without further notice - filter active.



Quote:> Hi everyone and thanks for the response Jeremy.

 
 
 

Using folder Agent to fire large MSAccess Job

Post by Barry G. Sumpte » Wed, 23 Aug 2000 15:37:37


Thanks you sir.

baz



> Barry,

> > I was hoping for souce to the custom script handler written by
Microsoft.
> > I want disect it and learn how to write my own.

> There you go:

> http://support.microsoft.com/support/kb/articles/Q192/3/39.ASP

> --
> Siegfried Weber

> Microsoft Most Valuable Professional (MVP) - Exchange Server
> Co-author of "Professional CDO Programming", Wrox Press 1999

> CDOLive - The Premier Resource for Microsoft Collaboration Data Objects
> http://www.cdolive.com

> Please reply to the newsgroups so that others can benefit from the
> discussion.
> Questions by e-mail are discarded without further notice - filter active.



> > Hi everyone and thanks for the response Jeremy.

 
 
 

1. Exchange Agent only fires first time on public folder

I have been working with a server side script that fires on a new message.
I was able to get it working using a folder in my mailbox.  Then I moved it
to a public folder (did use mailbox with proper permissions).  It doesn't
fire correctly in the public folder.  If I stop and restart the event
service it will fire on the messages that had been added to the folder, but
it never fires on new messages until I stop and start the service again.
The folder in my mailbox continues to work all the time.

Thanks for any help

--
Mike Moore , MCSE
Pella Corporation

2. Connecting with Workflow Manager

3. Event Agent Firing Problem - Please Help

4. Cant open ProcessInstance

5. Programmatically created Agents do not fire correctly

6. Internet Explorer Showing Public Folders

7. Using CDO in a scheduled job

8. web developer looking to recreate calendars from outlook

9. store.exe uses 100% cpu after maintenance jobs

10. OnTimer Event does not fire using Exchange Explorer

11. Folder Assistant rule not firing

12. Script event not firing in public folder