HELP ! Still same problem - VB shuts down 
Author Message
 HELP ! Still same problem - VB shuts down

 My App seems to start with some code, then causes error
 at some point after accessing data in a database.
It says that the program has performed an Illegal Operation,
and will be shut down.
 I've tried to trace EXACTLY where the problem occurs,
 but the program processes all the code inside one
 particular sub (accessing db) then it gets to the end
 (End Sub) and indicates the "Program will be shut down" error
 Problem is obviously inside that subroutine, but can't
 find out exactly where.

STRANGE HAPPENINGS:
App works if I first call up some OTHER program, run it
, then put it away and re-call my problem program back
 again.  When I run it after going thru that, it's OK.

ANY IDEAS,  SUGGESTIONS ??



Mon, 08 Sep 2003 07:37:58 GMT  
 HELP ! Still same problem - VB shuts down
Set a break point on the first line in your subroutine that is not a Dim
statement. Then your program will halt when it gets to that line and you
will be able to hit F8 to execute one line at a time.

-Steven Elliott


Quote:

>  My App seems to start with some code, then causes error
>  at some point after accessing data in a database.
> It says that the program has performed an Illegal Operation,
> and will be shut down.
>  I've tried to trace EXACTLY where the problem occurs,
>  but the program processes all the code inside one
>  particular sub (accessing db) then it gets to the end
>  (End Sub) and indicates the "Program will be shut down" error
>  Problem is obviously inside that subroutine, but can't
>  find out exactly where.

> STRANGE HAPPENINGS:
> App works if I first call up some OTHER program, run it
> , then put it away and re-call my problem program back
>  again.  When I run it after going thru that, it's OK.

> ANY IDEAS,  SUGGESTIONS ??



Tue, 09 Sep 2003 04:13:25 GMT  
 HELP ! Still same problem - VB shuts down
That's how I got to the End Sub line.
Re-read my post.
And Thanks for attempting, do you have any other
ideas of how I could find out EXACTLY where the
offending line occurs ?


Quote:
> Set a break point on the first line in your subroutine that is not a Dim
> statement. Then your program will halt when it gets to that line and you
> will be able to hit F8 to execute one line at a time.

> -Steven Elliott



> >  My App seems to start with some code, then causes error
> >  at some point after accessing data in a database.
> > It says that the program has performed an Illegal Operation,
> > and will be shut down.
> >  I've tried to trace EXACTLY where the problem occurs,
> >  but the program processes all the code inside one
> >  particular sub (accessing db) then it gets to the end
> >  (End Sub) and indicates the "Program will be shut down" error
> >  Problem is obviously inside that subroutine, but can't
> >  find out exactly where.

> > STRANGE HAPPENINGS:
> > App works if I first call up some OTHER program, run it
> > , then put it away and re-call my problem program back
> >  again.  When I run it after going thru that, it's OK.

> > ANY IDEAS,  SUGGESTIONS ??



Tue, 09 Sep 2003 08:53:41 GMT  
 HELP ! Still same problem - VB shuts down
I've seen this problem before. Check for an object declared in the
subroutine that is not closed and released (possibly an ADO object). The
object goes out of scope when the End Sub executes and VB doesn't do a very
graceful job of unloading the object.

Hope this helps


Quote:

>  My App seems to start with some code, then causes error
>  at some point after accessing data in a database.
> It says that the program has performed an Illegal Operation,
> and will be shut down.
>  I've tried to trace EXACTLY where the problem occurs,
>  but the program processes all the code inside one
>  particular sub (accessing db) then it gets to the end
>  (End Sub) and indicates the "Program will be shut down" error
>  Problem is obviously inside that subroutine, but can't
>  find out exactly where.

> STRANGE HAPPENINGS:
> App works if I first call up some OTHER program, run it
> , then put it away and re-call my problem program back
>  again.  When I run it after going thru that, it's OK.

> ANY IDEAS,  SUGGESTIONS ??



Tue, 09 Sep 2003 06:26:47 GMT  
 HELP ! Still same problem - VB shuts down
If Rocky's suggestion doesn't work, then a tried and tested method is to
comment out half of your offending subroutine and run it again.  Then you'll
know in which half the problem statement lies.  Do the same thing with that
half, and keep going until you have one statement remaining - your problem
statement.  If that's an 'Open' method on an object, for example, then it's
possible that VB doesn't close it properly for you, or you're even trying to
open it in the wrong way.

Once you know exactly which statement is causing your problem, it's likely
it will be an obvious reason.

If that fails, then re-post and describe exactly which other app's execution
makes your app run ok.

Good luck!

==============================
Nik Rivers
Software Development Engineer
Gladstone PLC [www.gladstoneplc.com]


Quote:
> I've seen this problem before. Check for an object declared in the
> subroutine that is not closed and released (possibly an ADO object). The
> object goes out of scope when the End Sub executes and VB doesn't do a
very
> graceful job of unloading the object.

> Hope this helps



> >  My App seems to start with some code, then causes error
> >  at some point after accessing data in a database.
> > It says that the program has performed an Illegal Operation,
> > and will be shut down.
> >  I've tried to trace EXACTLY where the problem occurs,
> >  but the program processes all the code inside one
> >  particular sub (accessing db) then it gets to the end
> >  (End Sub) and indicates the "Program will be shut down" error
> >  Problem is obviously inside that subroutine, but can't
> >  find out exactly where.

> > STRANGE HAPPENINGS:
> > App works if I first call up some OTHER program, run it
> > , then put it away and re-call my problem program back
> >  again.  When I run it after going thru that, it's OK.

> > ANY IDEAS,  SUGGESTIONS ??



Tue, 09 Sep 2003 17:30:54 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Shut down, how to intercept shut down?

2. Problem shutting down VB App after establishng connection

3. CR8.5 slow shut down problem / problem with p2bxbse.dll

4. Shutting down and powering down Win 2000

5. shutting down, rebooting, power down local host???

6. The Unsolvable Problem? A2K shutting down unexpectedly

7. Problem when shutting down Windows XP(RC2)

8. Problem Shutting Down ActiveX Exe

9. Problem shutting down Excel-process

10. Shut-down problems

11. Problem shutting down Excel-process

12. Problem shutting down Excel-process

 

 
Powered by phpBB® Forum Software