I have this problem (previously discussed in this NG) where a database
object keeps dissappearing. I have now converted all my database work to an
ADO type structure (previous was DAO) but it just changes the name of the
problem. Now I have my Connection object that keeps shutting down.
By using erro handling I can easily re-open the connection... but what I
want to know is wether it is possible for me to creat a single global,
project level error handler here I can do this?
The only error handler I can find is one that works in a procedure or nested
procedure.
Any pointers?
Michael
Albert D. Kallal - 21 Aug 2004 20:36 GMT
No, you can't create a gloal error handler.
For my connection, I alwas used currentdb (it is not clear if you are
talking a JET file share, or a server based applcton here).
Since I always use currentdb, then I never have aprobelm of a variable going
out of scpoe.
On the other hand, if you have errors, you should be dealing with.
However, I ahve ALWAYS given my users a mde file. With a mde, then any
un-trapped error DOES NOT re-set all my global vars (and, while we are at
this...we should advoid globabs anyway).
So, you might consider using a mde (and, alao you likey have long ago split
your database into two parts...right???).
And, I don't see why convering from dao to ado would fix anything in
reagidalrds to un-trapped erros and gloabl vars...how are these two issues
relantde?
Anyway...I would just use a mde..and then un-trapped erroresd don't re-set
your varables (local, or glables are not re-set).
>I have this problem (previously discussed in this NG) where a database
> object keeps dissappearing. I have now converted all my database work to
[quoted text clipped - 12 lines]
> Any pointers?
> Michael
Albert D. Kallal - 21 Aug 2004 20:38 GMT
Ops..bumped send key...sorry:
No, you can't create a global error handler.
For my connection, I always used currentdb (it is not clear if you are
talking a JET file share, or a server based application here).
Since I always use currentdb, then I never have a problem of a variable
going
out of scope.
On the other hand, if you have errors, you should be dealing with them.
However, I have ALWAYS given my users a mde file. With a mde, then any
un-trapped error DOES NOT re-set all my global vars (and, while we are at
this...we should avoid global anyway).
So, you might consider using a mde (and, also you likely have long ago split
your database into two parts...right???).
And, I don't see why converting from dao to ado would fix anything in
regards to un-trapped errors and global vars...how are these two issues
related?
Anyway...I would just use a mde..and then un-trapped errors don't re-set
your variables (local, or global are not re-set).

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.attcanada.net/~kallal.msn
Michael - 21 Aug 2004 21:07 GMT
I converted from DAO to ADO just to learn the technology, and I have the
impression it is the more moden approach. Anyway that is a minor point.
I have split my database into two parts. Tables in one MDB and evrything
else into the other MDB. I hve not yet implemnted the MDE part yet.
I am using JET file share
I was using currentDB... but that was where my problem started with the DB
object (a DAO.database) dissappearing.
> Ops..bumped send key...sorry:
>
[quoted text clipped - 28 lines]
> pleaseNOOSpamKallal@msn.com
> http://www.attcanada.net/~kallal.msn
Albert D. Kallal - 22 Aug 2004 04:54 GMT
> I was using currentDB... but that was where my problem started with the DB
> object (a DAO.database) dissappearing.
Hum...don't know why that would be the case. However, changing a bunch of
code likely did not fix this problem anyway!
However, as mentioned, your global vars problem can be fixed by using a mde.
In thinking about this whole problem, all
this code converting was not likely the fix here. Something else is not 100%
right.

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.attcanada.net/~kallal.msn