By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Cancel external process using event?

P: n/a
OK, the last time didn't get an answer, let's see if I can explain it
better. (Someone else here _must_ have done this at some point?)

I have a progress-meter type thing set up to follow the compacting of a
database, using Michael Kaplan's COM add-in. The plug-in exposes an
event as the the "pieces" are completed; this event includes a Cancel
argument, identical in nature to forms' BeforeUpdate and
BeforeDelConfirm events, etc.--set it to non-zero, and something should
stop, so says the documentation.

The difference is that those are validation-type cancels, and this is
an interrupt-heavy-procedure-outside-Access-type cancel. And it
doesn't work, or at least I don't know how to make it work; I click a
cancel button, the progress meter flickers briefly, and the compacting
continues. (DoEvents and DoCmd.CancelEvent have been tried in every
conceivable combination.)

Here are my questions:

1. If you expose an OnIncrement-type event with a Cancel argument, but
the procedure is intensive, can it still be cancelled?

2. Is "RaiseEvent" the same thing as calling the On_Event procedure?
In other words I'm not using a public class, but merely instantiating
the library object in my form module. Is this wrong? Do I have to
Raise in a class and Sink in a form class to get this to work?

3. More generally, how does one stop a fat procedure mid-execution, if
its code is deeper than Access? Or can you?

(FWIW you can't cancel menu-based compact and repair either, without
CTL-ALT-DELint out of Access...)

I've been up and down this group's google history, and no one seems to
have posted about these sorts of events before. And Monsieur Kaplan
does indeed mention the perils of unsupported plug-ins on his site. So
perhaps no one is silly enough to take this on...

Thanks in advance for any thoughts/silliness you might have/exhibit.

My last attempt at this question can be read here:
http://groups-beta.google.com/group/...6e32fdd929eab6

Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On 7 Apr 2005 10:02:40 -0700, "downwitch" <do*******@gmail.com> wrote:

<snip>
Thanks in advance for any thoughts/silliness you might have/exhibit.

Well, with PsKill you can kill practically anything.
(this is "A legitimate program that does not replicate, and does
exactly what it claims, yet might be unauthorized or unwanted by
reasonable end-users or administrators.")

David
Nov 13 '05 #2

P: n/a
Hmm... I don't doubt that there are programs out there that will do the
trick. For that matter, I could just switch off the PC ;).

I'm mainly trying to figure out how "deeply" I can control things via
VBA, or whether or not at some point I just turn over control to
Windows and ought to quit trying to stop a thing.

Nov 13 '05 #3

P: n/a

downwitch wrote:
Hmm... I don't doubt that there are programs out there that will do the trick. For that matter, I could just switch off the PC ;).

I'm mainly trying to figure out how "deeply" I can control things via
VBA, or whether or not at some point I just turn over control to
Windows and ought to quit trying to stop a thing.


To my knowledge this is a Microsoft thing and you'll loose your hair
trying to get this to work. As you suggested, turning of the PC would
be faster. Once the compact begins it becomes an internal process of
the application, and it can't be stopped programaticaly since there is
no rollback and database corruption is a high probability.

Nov 13 '05 #4

P: n/a
Considering the likelihood of your corrupting the new database by doing
that, are you sure this is something that actually should or needs to
be done? IIRC, compacting rewrites indices and other fun internal
files for Access, so certainly if you attempt to stop the process
before it completes, you're bound to end up with something less than a
useable database. And what's the point of that? Sure, you may have to
wait a while for the thing to finish, but so what? If the alternative
is to have no database left at all, then it's not really an
alternative, is it?

Nov 13 '05 #5

P: n/a
I know compacting's not a great example. It's not dangerous--the file
being "compacted" is a copy, not the original, as you can see if you
launch a compact from the menu and watch the folder in explorer--but it
is a process that is relatively silly to interrupt.

But that doesn't nullify the more general question: can you stop
something that's put in motion just because a custom event says you
can? I suspect access-guru has the answer.

But I'll bump it up one more time just in case...

Nov 13 '05 #6

P: n/a
On 8 Apr 2005 16:19:45 -0700, "downwitch" <do*******@gmail.com> wrote:
I know compacting's not a great example. It's not dangerous--the file
being "compacted" is a copy, not the original, as you can see if you
launch a compact from the menu and watch the folder in explorer--but it
is a process that is relatively silly to interrupt.

But that doesn't nullify the more general question: can you stop
something that's put in motion just because a custom event says you
can? I suspect access-guru has the answer.

But I'll bump it up one more time just in case...

Hi
The stopping of the motion is something that the the code which runs
the event (the DLL in this case) would provide. Presumably the compact
is done to a copy which, if cancelled, is not saved. Reading the
description on Michael Kaplan's site suggests that he has done this,
so maybe your cancel isn't getting through correctly. I only have A97
here so I can't play with this I'm afraid.
David
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.