473,416 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Odd error trapping

Jon
It appears that application.exit isn't doing what I think it should be
doing. The line oRpt.SetupReportDatabase() causes an except and the
exception is caught and the messagebox with the error message pops up, as it
should. However, the application does not exit, and the MsgBox("Making
params") is executed from the next block of code and execution continues on.
Am I doing something wrong? Shouldn't application.exit immediately stop the
program. Thanks for any insight!

I have the following code:

Try
MsgBox("Enter create report")
oRpt = New MSIReporting.MSICrystal(strNewReport,
DBName, AppSettings("WOServer"), AppSettings("WOLogin"),
AppSettings("WOPassword"))

MsgBox("Exit create report")

MsgBox("Set up report DB")
oRpt.SetupReportDatabase(DBName,
AppSettings("WOServer"), AppSettings("WOLogin"), AppSettings("WOPassword"))
MsgBox("Done report db")
Catch ex As Exception
MsgBox("APPEXIT " + ex.Message)

Application.Exit()
End Try

Try
MsgBox("Making params")

ReDim oCRParamsName(1, 1)
oCRParamsName(0, 0) = "WO"
oCRParamsName(0, 1) = drRow(3)
Nov 21 '05 #1
1 940
No. Application.Exit just signals the message loop for the current
application to terminate. The loop can't terminate until you return control
to it. Try adding an Exit Sub after the Application.Exit so you can return
control back to the caller. (I assume this code is inside some Click event
handler or such).

"Jon" wrote:
It appears that application.exit isn't doing what I think it should be
doing. The line oRpt.SetupReportDatabase() causes an except and the
exception is caught and the messagebox with the error message pops up, as it
should. However, the application does not exit, and the MsgBox("Making
params") is executed from the next block of code and execution continues on.
Am I doing something wrong? Shouldn't application.exit immediately stop the
program. Thanks for any insight!

I have the following code:

Try
MsgBox("Enter create report")
oRpt = New MSIReporting.MSICrystal(strNewReport,
DBName, AppSettings("WOServer"), AppSettings("WOLogin"),
AppSettings("WOPassword"))

MsgBox("Exit create report")

MsgBox("Set up report DB")
oRpt.SetupReportDatabase(DBName,
AppSettings("WOServer"), AppSettings("WOLogin"), AppSettings("WOPassword"))
MsgBox("Done report db")
Catch ex As Exception
MsgBox("APPEXIT " + ex.Message)

Application.Exit()
End Try

Try
MsgBox("Making params")

ReDim oCRParamsName(1, 1)
oCRParamsName(0, 0) = "WO"
oCRParamsName(0, 1) = drRow(3)

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
3
by: Smriti Dev | last post by:
Hi There, I have the following code and when I try to run it, I get a type mismatch error. I would really appreciate your help with this. Thanks kindly, smriti --- Private Sub cmdOK_Click()
2
by: Captain Nemo | last post by:
I'm still using Office 2000 myself, but some of my clients have Office 2003. I've recently added a piece of code to create an instance of Word, open a document, fill in the blanks and become...
9
by: 47computers | last post by:
Pretty new to PHP, I recently started learning about error trapping. As of right now, I include the following into a page in my website: -------BEGIN PASTE-------- error_reporting(E_ERROR |...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.