jawahar_prasad
asked on
How to Catch DB connection error in ASP??
How to Catch DB connection error in ASP??
This is the code I am using to connect to MS Excel DB.
Set cnnGetRows = Server.CreateObject("ADODB .Connectio n")
connExcel="Provider=Micros oft.Jet.Ol eDb.4.0;Da ta Source="&(url1)&"; Extended Properties=Excel 8.0;"
cnnGetRows.Open connExcel
set rs=server.CreateObject("ad odb.record set")
mysql="SELECT * FROM project_details"
rs.open mysql,cnnGetRows <--- I am getting CONNECTION ERROR HERE WHEN THE EXCEL SHEET IS OPENED OR IF THE DATABASE IS NOT DEFINED...
It is showing the usual asp error page and line number, I need to catch this error and display custom message
This is the code I am using to connect to MS Excel DB.
Set cnnGetRows = Server.CreateObject("ADODB
connExcel="Provider=Micros
cnnGetRows.Open connExcel
set rs=server.CreateObject("ad
mysql="SELECT * FROM project_details"
rs.open mysql,cnnGetRows <--- I am getting CONNECTION ERROR HERE WHEN THE EXCEL SHEET IS OPENED OR IF THE DATABASE IS NOT DEFINED...
It is showing the usual asp error page and line number, I need to catch this error and display custom message
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
asp->excel (connection errors)
sorry, please delete this and previous comments (I was trying to add this thread to my knowledge base) and got confused
As already suggested to other users I request you to create Tracefiles. This can be used to sort out any issues that happens in the application. For creating tracefiles you can use the FSO (File System Object) method