Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping Long Running Import Process 1

Status
Not open for further replies.

sabloomer

Technical User
Aug 8, 2003
153
US
I have a form that is used to launch a couple different import processes. The code that does the importing is located in a Public Class Module. How do I get a "stop" button on the form to stop the importing proceces?

A little about the process. The import reads an Access table and loops through the records and imports the transactions. This is required to import the transactions into our ERP system. I can let the current record import, but I want to stop before the next one.

Thank You,

Scott
 
Run the process in a different thread. Keep a reference to that thread available from the primary thread. Call the Thread.Abort method to kill the process at any time. Handle the ThreadAbortException in your import code and clean up any open connections.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thank You. It looks like I have some reading to do about threads!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top