[AccessD] DirWatcher - was RE: Cool stuff - was RE: using adtsxin .Net

JWColby jwcolby at colbyconsulting.com
Sat Apr 21 23:29:34 CDT 2007


Borge,

This all started when I watched a webcast video from a series that MS is
publishing.  They all seemed aimed at nudging VB6 folks to start using
VB.Net.  I am not a VB6 person, perhaps unfortunately.  

Anyway, I found this webcast in the start page of Visual Studio, but in fact
the email someone sent has the page to go to find these things.

http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=103233340
8&EventCategory=3&culture=en-US&CountryCode=US

Watch for wrap.

I know NOTHING about this other than what I learned in the webcast.  The
webcast showed how to build a com object from DotNet to do this stuff.  I
watched it, I typed it all in and built it.  I referenced it from Access,
built a demo etc. and it worked (after I figured out one syntax error).

How it worked I do not yet understand, in fact it is waaaay over my head.
This is a classic case of "they went too far", i.e. they should have stopped
at the diskwatcher but they did not, they wanted to show other (more
advanced) cool stuff.  Anyway, watch the video and see what you can get.  I
am now trying to lobotomize their COM widget to NOT do the extra cool stuff
because it gets in the way of actually using the disk watcher as a simple
diskwatcher.  

Basically they also read the contents of the files placed in the watched
directory into memory and then pass that off to the using application as a
parameter.  IOW when you sink an event in Access (or VB6) you get the actual
contents of the file in something - I think it is an array of strings but I
am not sure.  They also delete the file after they read it into this memory.


I don't WANT either of these functionalities, I just want to be notified
that there are files in the dir.  Some of the files I am processing are
multi-gigabyte text files.  I sure as hell don't want this thing trying to
read that into memory and pass it to my Access app thank you very much.  I
can go to the directory and open a text stream and do my own reading.  I
also don't want them deleting the file, I can do what I want with the file
when I am finished processing it.

But they had to be cool.

Anyway, there you are.  I am such a nubee that I will have to watch the
video several times to even begin to understand the finer points of it.

I have always been impressed with .Net, at least since version 2.0 came out.
It is very powerful stuff, and yes, I am trying to get into it.  I now
actually have a use for it - if I could just find the year required to
struggle up the learning curve.  I think it is just a matter of keeping at
it, day after day, week after week until it becomes familiar.  Hard to do
when you have way more Access work to do than you can ever get done which is
where I am right now (not complaining though).

BTW I posted the code (with one small syntax error) but it got caught in the
email size filter and never made it through to the list.

I will get back to you when I have this com object running the way I need
it.

John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Borge Hansen,
Professional Computer Systems
Sent: Saturday, April 21, 2007 9:31 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] DirWatcher - was RE: Cool stuff - was RE: using
adtsxin .Net

Jon,
I am reading the thread with great interest.
I think a lot us hanging out in this forum are seeing the need of getting up
to speed with .net and sql server etc.
... and wishing we had more time.

if you have time, would you mind going through the steps involved for
creating what you did.

I understand there is a .net object - among the many thousands -  you refer
to as "DotNet DiskWatcher object". - What's the name?

You write some .net code using this object that will monitor a Folder and
alert you when things happens in the folder. What does the code look like.

Then you write a "wrapper" so the .net code can be used in VB and more of
interest in VBA.
What does the wrapper code look like - the com object?

Then there is the issue of registered the com object.
Marty is writing about certain code for using this.
What's the connection between the .dll file and .tlb file ?
Is the .dll file the file that contains the com object. what's the function
of the tlb file?

You didn't need to register the com object as it gets registered on the
machine you built the code on.

You then used the com object in some vba code, copy of which you showed us,
right?

hmmm.... so much ... to get around to finding a 'easy' way to make .net
functionality available in vba code

Here's another link:
Visual Basic Fusion: Best Practices to Use Visual Basic 6 and Visual Basic
.NET Together http://msdn2.microsoft.com/en-us/library/ms364069(vs.80).aspx

borge




More information about the AccessD mailing list