473,394 Members | 1,869 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,394 software developers and data experts.

On Error ... Fails! - Any suggestions

Hi,

I've got some code which uses various "On Error" statements to try to trap
some errors in VB6. When I try it on one machine (WinXP SP1) it works fine,
but on another machine (WinXP SP2) it fails to trap the error and so the
code fails. e.g.
On Error Resume Next
debug.print 3/0

Would fail on the "debug" line.

On Error Goto Fred
debug.print 3/0
Fred:

would also fail on the "debug" line

Any suggestions??

Without this basic error trapping the whole application is screwed.

Thanks

Andy
Jul 17 '05 #1
3 3903

"Andy" <a@a.com> wrote in message
news:d6**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi,

I've got some code which uses various "On Error" statements to try to trap
some errors in VB6. When I try it on one machine (WinXP SP1) it works fine,
but on another machine (WinXP SP2) it fails to trap the error and so the
code fails. e.g.
On Error Resume Next
debug.print 3/0

Would fail on the "debug" line.


Right click on your code somewhere, choose Toggle, and select "Break on
Unhandled Errors".
Jul 17 '05 #2

"Andy" <a@a.com> wrote in message
news:d6**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi,

I've got some code which uses various "On Error" statements to try to trap
some errors in VB6. When I try it on one machine (WinXP SP1) it works fine, but on another machine (WinXP SP2) it fails to trap the error and so the
code fails. e.g.
On Error Resume Next
debug.print 3/0

Would fail on the "debug" line.

On Error Goto Fred
debug.print 3/0
Fred:

would also fail on the "debug" line

Any suggestions??

Without this basic error trapping the whole application is screwed.

Thanks

Andy


I believe the debug.print would be outside your program scope. Does it
handle it correctly if you do:

On Error Resume Next
x = 3/0
Debug.Print "The error handler worked"
Jul 17 '05 #3
That solved it - after all these years with vb, I'd never had the need to
use that option.

Thanks

Andy
"Steve Gerrard" <my********@comcast.net> wrote in message
news:0L********************@comcast.com...

"Andy" <a@a.com> wrote in message
news:d6**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi,

I've got some code which uses various "On Error" statements to try to trap some errors in VB6. When I try it on one machine (WinXP SP1) it works fine, but on another machine (WinXP SP2) it fails to trap the error and so the
code fails. e.g.
On Error Resume Next
debug.print 3/0

Would fail on the "debug" line.


Right click on your code somewhere, choose Toggle, and select "Break on
Unhandled Errors".

Jul 17 '05 #4

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

Similar topics

2
by: fabrizio.blanco | last post by:
Hi all, I'm trying to setup a standby server using log shipping. The live database has a user exit in place, which archives the closed logs and ships them to the standby server. The standby...
3
by: Alberto Giménez | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there! I'm doing some homework (almost finished), but now i'm reconsidering a design decission I made at the beginning. This is about error...
3
by: Antoine | last post by:
Hello, I'm writing a program to send requests to my wlan pocket pc device (UIO1: driver) in C#. Here how I import CreateFile functions from coredll.dll with DllImport: public static extern...
2
by: Nigel Frost | last post by:
I have a .Net console application. It creates a user's folder, sets permissions using WMI, then fails to give the ownership of that folder to the user (for quotas). This all executes on a single...
3
by: Gary Varga | last post by:
In the file WebUIValidation.js, when a postback that doesn't fail the validation has a javascript error saying summary is undefined in the ValidationSummaryOnSubmit function....
0
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get:...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Languageâ€, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
3
by: Kai Schlamp | last post by:
Hello! In my schema I have the following: <xs:complexType name="textareaType"> <xs:simpleContent> <xs:restriction base="xs:string"> <xs:attribute ref="label" use="required" />...
6
by: GlenGage | last post by:
My application creates Word documents. The routine below takes an existing, open document (vobjSourceDocument) and makes a new document (robjNewDocument) similar to it. The routine works 999+ times...
0
by: pinky22 | last post by:
I am calling SSIS package from a .Net windows UI. Both SSIS & .Net app are created in 2008. The SSIS package is stored in file system. When I ran .Net app I got error- The package failed to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.