Checking for Oracle Conection 
Author Message
 Checking for Oracle Conection

We're using a VB5 ODBCdirect connection to do some simple updates on
some records in an Oracle 7.3 database.  Now we need to create
contingency code for the times when the database is down.  The current
idea is to create an "OracleUp()" function to check that the database is
there.

There are a couple of ways this could go and I'm looking for comments.
One idea is to establish the connection during the form load and then
check the properties of the connetion before updates.  I'm not sure if
these properties will be current if the connection has not been used.
So it may return true because it got a connection during form load even
though the connection has been lost.

The other idea is to establish a new connection in the OracleUp()
function.  I'm guessing this will take too much time.

The last idea is to call Oracle's TNSPING.EXE.

Any experiences/comments apprecitiated.

Patrick Murphy
Database Administrator
Cutrale Citrus Juices, USA



Thu, 24 Aug 2000 03:00:00 GMT  
 Checking for Oracle Conection

Hi all,

does anyone have a small utility to convert Visual Basic 3 code to visual
basic 5 ?

(vb3 binary source won't load into vb5 - I'm sure I don't have to buy a copy
of vb3 to convert these do I ? )

Mike

--

                http://www.redrobe.demon.co.uk



Thu, 24 Aug 2000 03:00:00 GMT  
 Checking for Oracle Conection



Quote:
>We're using a VB5 ODBCdirect connection to do some simple updates on
>some records in an Oracle 7.3 database.  Now we need to create
>contingency code for the times when the database is down.  The current
>idea is to create an "OracleUp()" function to check that the database is
>there.

>There are a couple of ways this could go and I'm looking for comments.
>One idea is to establish the connection during the form load and then
>check the properties of the connetion before updates.  I'm not sure if
>these properties will be current if the connection has not been used.
>So it may return true because it got a connection during form load even
>though the connection has been lost.

>The other idea is to establish a new connection in the OracleUp()
>function.  I'm guessing this will take too much time.

>The last idea is to call Oracle's TNSPING.EXE.

>Any experiences/comments apprecitiated.

>Patrick Murphy
>Database Administrator
>Cutrale Citrus Juices, USA

If you have resource limits enabled or do a shutdown immediate, your
VB app can think it is connected when in fact it is not.  The simplest
thing to do would be to issue a SELECT USER FROM DUAL statement within
your OracleUp funcion.  If the connection is good, you won't get an
error.  If not, you can examine the error number to determine why the
connection is gone.

We found the hard way that this isn't necessarily going to catch all
the connection problems.  For instance, a lot of our customers do a
shutdown immediate before starting the backup.  In this case, the app
can be right in the middle of a query and still get knocked off.  We
created a centrailized error-checking routine to determine the cause
of most Oracle errors.

HTH

--
Mark Wagoner
To reply, remove no.spam from my e-mail address



Fri, 25 Aug 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. TCP/IP Conection with Visual Basic + Oracle 9i

2. Oracle, check box and remote data control

3. Does VB6 have status checking with Oracle ?

4. Oracle's Check Constraints in ADO

5. How do you check Oracle idle time out in ADO

6. Connecting to Oracle thru Oracle OLE DB Provider(OraOLDDB.Oracle)

7. Help with ODBC Conection Code

8. Conection to IMAP with CDO

9. Persistent conection?

10. Database (MSSQL 6.5) conection over OLE ?

11. Internet Conection from VB5

12. Internet conection from VB5

 

 
Powered by phpBB® Forum Software