0

How check that database record is not present in ASP page?
i have two combo boxes, selecting both if the record is present in the database it is showing, but if the record is not present how to check that & how to show msg?

Edited by snehalj: n/a

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by snehalj
0

A better explanation may help. For example, are you first querying if a particular record/s exist in the database and how?

0
<p> Consumer Court Cases - Particulars of litigation pending against IDBI Homefinance Ltd. </P>
<table border="1" width="90%" cellspacing="0" cellpadding="0">			
<tr ALIGN="center">
<td width=5%><font SIZE="2" face="Verdana"><b>Case No</b></font></td>
<td width=10%><font SIZE="2" face="Verdana"><b>Customer Name</b></font></td>
<td width=7%><font SIZE="2" face="Verdana"><b>Start Month</b></font></td>
<td width="5%"><font SIZE="2" face="Verdana"><b>Amount</b></font></td>
<td width="20%"><font SIZE="2" face="Verdana"><b>Case Description</b></font></td>
<td width="20%"><font SIZE="2" face="Verdana"><b>Current Status</b></font></td>
</tr>
</table>
<%set list=con.execute("Select * from courtcase_new where FinYear='"& FinYear &"' and BranchName='"& BranchName &"' and casedrop is null and decreed is null and casecategory ='Consumer'")%>
<%while not list.Eof%>
<%casecat= trim(list("casecategory") )
var1= 0
var1 = len(casecat)%>		
<% if var1 = 8 then %> 
<table border="1" width="90%" cellspacing="0" cellpadding="0">	
<%flag = true%>  
<tr align="center">
<td width=5%><font SIZE="2" face="Verdana"><%=list("caseno")%></font></td>
<td width=10%><font SIZE="2" face="Verdana"><%=list("partyname")%></font></td>
<td width=7%><font SIZE="2" face="Verdana"><%=list("iMonth")%></font></td>
<td width="5%"><font SIZE="2" face="Verdana"><%=list("amount")%></font></td>
<td width="20%"><font SIZE="2" face="Verdana"><%=list("particulars")%></font></td>
<td width="20%"><font SIZE="2" face="Verdana"><%=list("currentstatus")%></font></td>
</tr>
</table>
<%end if %>
<%list.MoveNext%>
<%Wend%>

i have written above code for displaying database records, and now i want code for displaying msg if record is not present in database as per the query.
i hope this explanation will enough to understand problem.Pls tell me if u need info other than this.
thanks in advance

0

Between line 23 and 14 add...

if NOT list.EOF then

Then after line 32 add...

else
response.write"No record found"
end if
0

thank u so much
i had tride same code but it didnt work because of position where i had written.
now its working perfectly

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.