pwinters
Programmer
- Sep 12, 2002
- 34
How can I display something other than this Invalid Use of Null error? I know there is no data in the database for what I've searched on, but I don't want the user to see this error. I'd rather see something like "No Results Found for your Search".
Here is some of my code:
These fields are pulled from a form, and if the user selects an option that has no data associated with it, the "Invalid Use of Null" System Error appears. Can I get around this?
<%
fragid = request.getParameter("fragid"
;
String fragval;
if ((fragid == null) || (fragid.equalsIgnoreCase("null"
))
fragval = "";
else fragval = " and Dashboard.fragment_id =" + fragid;
String relval;
if ((releaseid == null) || (releaseid.equalsIgnoreCase("null"
))
relval = "";
else relval = " and Dashboard.BRMonth_Id = " + releaseid;
String yrval;
if ((yearid == null) || (yearid.equalsIgnoreCase("null"
))
yrval = "";
else yrval = " and Dashboard.BRYear_Id = " + yearid;
String total=
"SELECT Format(Clng(Sum(Dashboard.Recycled_Usage)), '#,###') AS SumOfRecycle, " +
"Format(Clng(Sum(Dashboard.Usage)), '#,###') AS SumOfUsage, " +
"Format(Clng(Sum(Dashboard.Bit_amt)), '#,###') AS SumOfBit " +
"FROM Dashboard " +
" WHERE Dashboard.Production_Id > 0" +
fragval +
relval +
yrval;
...
...
%>
Thanks
Here is some of my code:
These fields are pulled from a form, and if the user selects an option that has no data associated with it, the "Invalid Use of Null" System Error appears. Can I get around this?
<%
fragid = request.getParameter("fragid"
String fragval;
if ((fragid == null) || (fragid.equalsIgnoreCase("null"
fragval = "";
else fragval = " and Dashboard.fragment_id =" + fragid;
String relval;
if ((releaseid == null) || (releaseid.equalsIgnoreCase("null"
relval = "";
else relval = " and Dashboard.BRMonth_Id = " + releaseid;
String yrval;
if ((yearid == null) || (yearid.equalsIgnoreCase("null"
yrval = "";
else yrval = " and Dashboard.BRYear_Id = " + yearid;
String total=
"SELECT Format(Clng(Sum(Dashboard.Recycled_Usage)), '#,###') AS SumOfRecycle, " +
"Format(Clng(Sum(Dashboard.Usage)), '#,###') AS SumOfUsage, " +
"Format(Clng(Sum(Dashboard.Bit_amt)), '#,###') AS SumOfBit " +
"FROM Dashboard " +
" WHERE Dashboard.Production_Id > 0" +
fragval +
relval +
yrval;
...
...
%>
Thanks