database connection error handling 
Author Message
 database connection error handling

I'm using the following ADO lines to open a connection with some ODBC
'datasource'

Set conn = Server.CreateObject("ADODB.Connection")
conn.open datasource, "", ""
....
sql = "SELECT ..."
...
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3

When the 'datasource' is invalid, my NT 4.0 server easily gets into
infinite loop (inetinfo.exe)...

Is there any easy way for me to check whether the 'datasource' is
valid?  Or does 'conn.open/rs.open' ever returns any error message?

Thanks a lot!

Julie



Sun, 29 Jul 2001 03:00:00 GMT  
 database connection error handling
Normally it will halt with an error if the DSN is not valid -- you must have
"On Error Resume Next" set.

If so, just check for Err=0 after the conn.open statement.

If not, something very strange is happening and we'd need to see more code.

Ken

Quote:

>I'm using the following ADO lines to open a connection with some ODBC
>'datasource'

>Set conn = Server.CreateObject("ADODB.Connection")
>conn.open datasource, "", ""
>....
>sql = "SELECT ..."
>...
>Set rs = Server.CreateObject("ADODB.Recordset")
>rs.Open sql, conn, 3, 3

>When the 'datasource' is invalid, my NT 4.0 server easily gets into
>infinite loop (inetinfo.exe)...

>Is there any easy way for me to check whether the 'datasource' is
>valid?  Or does 'conn.open/rs.open' ever returns any error message?

>Thanks a lot!

>Julie



Sun, 29 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO - PELogOnSQLServerWithPrivateInfo() Handle to database connection

2. How do I handle database connection over API?

3. Database Connection Error.

4. Connection Success Error Handling

5. Async connection error handling

6. Oracle Connection Error Handling

7. Error handling and Database Transactions

8. RDO Error Handling -howto? (example: database falls)

9. Error handling and Database Transactions

10. Error handling and Database Transactions

11. HELP !!! Database Error Handling in VB

12. RDO Error Handling -howto? (example: database falls)

 

 
Powered by phpBB® Forum Software