473,761 Members | 2,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cancel external process using event?

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
BeforeDelConfir m 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.CancelEve nt 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
6 2000
On 7 Apr 2005 10:02:40 -0700, "downwitch" <do*******@gmai l.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
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

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
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
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
On 8 Apr 2005 16:19:45 -0700, "downwitch" <do*******@gmai l.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1356
by: Paul Rubin | last post by:
Anyone know if there's code around to filter text through an external process? Sort of like the Emacs "filter-region" command. For example, say I have a program that reads input in English and outputs it in Pig Latin. I want my Python script to call the program, pipe some input into it and read the output: english = "hello world" pig_latin = ext_filter("pig_latin", english) should set pig_latin to "ellohay orldway".
2
1324
by: Peter Wood | last post by:
I am attempting to run an external process from within my web service, but nothing happens. No errors are thrown, nor are any eventlog messages written. If I call the same classes directly from a WinForms app (not through the web service), it works fine. I realise that the difference is that the webservice runs under the ASPNET user and WinForms is running under the interactive user (I have checked, and this is the case). Both are local...
8
2067
by: ToMasz | last post by:
There is a script running continuously which executes an external script in a loop using os.spawnlp(os.P_WAIT, 'extscript.py') function. After several hundred executions (cycles of the loop), the main script gets an exception while trying to start the process. This situation is repeated until the main script is killed. Before it is killed, no other command can be executed - I'm getting the message: -bash: fork: Resource temporarily...
2
1293
by: Mythran | last post by:
ASP.Net v1.1 Trying to create and start an external process (run another application). This application can take a few minutes to complete, but I want the ASP.Net web page to return immediately without killing the process it started. Basically, the user uploads a file which is saved to the server disk. The web app needs to start the application that parses, amongst other things, the file and modifies the database accordingly. Because...
1
1310
by: david.sargent | last post by:
I have a C# program launching an external process, say notepad. I have the process hidden from the user, and want to be able to take screenshots of the hidden program. I have searched around and found people using Printwindow() with a pointer to the application, but every time all I get is a black window...anybody know how to do this correctly? Thanks David
0
855
by: Aan | last post by:
I need to use e.cancel from column changing event to keep the selected cell from moving to the next cell when the error arise. Is there any one know? Or is there another way to solve the problem? Thx before...
7
2957
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I am attempting to fetch data from an external process. It seems to work OK with regular arguments, but not with switch arguments. Here is an example of a failure: =================================== ProcessStartInfo psi = new ProcessStartInfo("date","/t"); psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; psi.CreateNoWindow = true; process = new Process();
9
7672
by: kimiraikkonen | last post by:
Hello, I want to automate something and display a simple msgbox that indicates my external process finished processing and "exited". My code is that, what things should i add more: Dim psInfo As New System.Diagnostics.ProcessStartInfo("bla.exe", "-b ") psInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
5
1818
by: ags5406 | last post by:
I've a Windows Service that keeps a particular executable running. If the executable fails for whatever reason, the Service restarts it. Right now I'm using a loop to check if the process is running. I started with an infinite loop that ate up all of my resources, but then added a 2 second pause after every check, which seems to have mostly eliminated the problem of my resources being used up. However, I'm wondering if there is a...
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.