• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 792
  • Last Modified:

customErrors in Web.config doesn't work

customErrors in web.config is not triggering error page
Whats wrong ?

in Adjutsmest.aspx, the db connectiuon is wrong and I expect it to redirect to ErrPage.htm. But instead getting standard error and i.e.

System.Data.OleDb.OleDbException: 'c:\principia\GiCS.mdb' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

Here are the file listings

<customErrors mode="On" defaultRedirect="ErrPage.htm"/>


   We are very sorry for the inconvenience caused to you...<br>


string local_connect_string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\principia\\GiCS.mdb" ;
                  //string strSQL="SELECT  a.[Gic ID],a.Entry_Date, a.Principal, a.Interest, a.Type FROM Adjustments a where a.Entry_Date = (Select max(Entry_Date)  from adjustments  where [Gic ID]=a.[Gic ID]) ORDER BY a.[Gic ID]";
                  string strSQL = "SELECT a.[Gic ID], Max(a.Entry_Date) AS Entry_Date, Sum(a.Principal) AS Principal,Sum(a.Interest) as Interest ,a.Type  FROM Adjustments AS a  GROUP BY a.[Gic ID] , a.Type ORDER BY a.[Gic ID];";
                  OleDbConnection myConnectionString = new OleDbConnection(local_connect_string);
                  OleDbCommand adjCommand = new OleDbCommand(strSQL,myConnectionString);

                  OleDbDataReader dxReport;
                  catch(Exception err)

1 Solution
Rodney HelsensCommented:
You have a try catch block there. I suspect that is catching the error and therefore the exception is handled..

comment out that block and see what happens
jitgangulyAuthor Commented:

thanks a lot
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now