Subject: Database connection
Posted By: lshamba Post Date: 11/1/2004 12:00:35 AM
HELLO,

I want to write some error handling code in my asp page for when a SQL database is unavailable or when a table is locked.

1. What's the best way of checking if SQL server is running. Should I use  object.state to determine if the connection is open.  
2. How can I cater for instances where a SQL table is locked.

Thanks,
Cassandra

Cass
Reply By: rajanikrishna Reply Date: 11/1/2004 5:01:23 AM

on error resume next

set conn=server.createObject("ADODB.connection")
conn.connectionString="Provider=SQLOEDB..."
conn.open

'If the connection has any problem, the Err object contains the corr error no.
if Err.number<>0 then
   response.write Err.description
   .......
end if


-------
Rajani



Go to topic 21365

Return to index page 727
Return to index page 726
Return to index page 725
Return to index page 724
Return to index page 723
Return to index page 722
Return to index page 721
Return to index page 720
Return to index page 719
Return to index page 718