bloke
05-30-2003, 06:13 AM
Can someone please take a quick look at this and tell me why a record that meets the conditions to be excluded still appears.
It is probably something very obvious that I can't see for looking.
<%
If rscorres.EOF Then%>
<tr bgcolor="#ffffff" class="doctitle" align="center">
<td colspan="4">Sorry, there are no items which match your search</td>
</tr>
<%Else
Do While Not rscorres.EOF 'loop through records until end of file
If rscorres("sensitive") = true Then 'if the current record has a field called sensitive with a value of True then...
'which it is for the record in question
'..check this
If strsensitive <> rscorres("sens_name") Then 'if the network logon userid (determined earlier) does not equal the corresponding value in the current record then....
'which is true in this case
rscorres.movenext '...skip this record
End If
If rscorres.eof Then 'if there are no more records then....
'which should be ignored as there are other records to write
Exit Do '....end the loop
End If
End If
'....if the record is not sensitive (which it is) then......
'....set variable values from record set values...
intDay = DAY(rscorres("date_logged"))
intMonth = MONTHNAME(MONTH(rscorres("date_logged")))
intYear = YEAR(rscorres("date_logged"))
strDate = intDay & " " & intMonth & " " & intYear
strURL = "documents/loaded/" & rscorres("document_name")
'...then write the values to the page ..AND THE SODDING RECORD APPEARS HERE!!
%>
<tr bgcolor="#ffffff" onmouseover="this.bgColor = '#C0C0C0';window.status=''" onmouseout="this.bgColor = '#ffffff'" class="doctitle">
<td align="center"><a href="javascript:newWindow('<%=strURL%>')"><img src="../images/magnify.gif" border="0"></a></td>
<td><%=replace(rscorres("contract_no"), "_", "/")%></td>
<td><%=rscorres("document_name")%></td>
<td><%=strDate%></td>
</tr>
<%
rscorres.movenext 'move on to next record
Loop%>
Cheers
It is probably something very obvious that I can't see for looking.
<%
If rscorres.EOF Then%>
<tr bgcolor="#ffffff" class="doctitle" align="center">
<td colspan="4">Sorry, there are no items which match your search</td>
</tr>
<%Else
Do While Not rscorres.EOF 'loop through records until end of file
If rscorres("sensitive") = true Then 'if the current record has a field called sensitive with a value of True then...
'which it is for the record in question
'..check this
If strsensitive <> rscorres("sens_name") Then 'if the network logon userid (determined earlier) does not equal the corresponding value in the current record then....
'which is true in this case
rscorres.movenext '...skip this record
End If
If rscorres.eof Then 'if there are no more records then....
'which should be ignored as there are other records to write
Exit Do '....end the loop
End If
End If
'....if the record is not sensitive (which it is) then......
'....set variable values from record set values...
intDay = DAY(rscorres("date_logged"))
intMonth = MONTHNAME(MONTH(rscorres("date_logged")))
intYear = YEAR(rscorres("date_logged"))
strDate = intDay & " " & intMonth & " " & intYear
strURL = "documents/loaded/" & rscorres("document_name")
'...then write the values to the page ..AND THE SODDING RECORD APPEARS HERE!!
%>
<tr bgcolor="#ffffff" onmouseover="this.bgColor = '#C0C0C0';window.status=''" onmouseout="this.bgColor = '#ffffff'" class="doctitle">
<td align="center"><a href="javascript:newWindow('<%=strURL%>')"><img src="../images/magnify.gif" border="0"></a></td>
<td><%=replace(rscorres("contract_no"), "_", "/")%></td>
<td><%=rscorres("document_name")%></td>
<td><%=strDate%></td>
</tr>
<%
rscorres.movenext 'move on to next record
Loop%>
Cheers