I've been trying every combination to make this if then statement work on my ASP page. I've calling fields from 2 access database, then I need to compare both to see if there is a facility that has a report against them.
At first I was using the facility name as the anchor to both database files. It worked pretty good until there was an issue with double quotes in the name. This code worked
<%
for k=0 to y-1
if (B(1,k)) = facility then
%>•<a href="detail-e.asp?ID=<%=B(0,k)%>"><%=B(2,k)%></a><br /><%
end if
NEXT
%>
So all I did was add a facility id number in the second database (row 12) since the ID already existed in the first database
<%
for k=0 to y-1
response.write(ID)
response.write("\")
response.write(B(12,k))
if (B(12,k)) = ID then
response.write("TRUE")
%>•<a href="detaile.asp?ID=<%=B(0,k)%>"><%=B(2,k)%></a><br /><%
else
response.write("FALSE")
end if
response.write("<br>")
NEXT
%>
as you can see, I've tested that the values are acually the same. The results of this If Then is;
2006225\2006225FALSE 2006225\2007101FALSE 2006225\2006225FALSE 2006225\2004245FALSE 2006225\279025FALSE 2006225\2006225FALSE 2006225\2006225FALSE 2006225\2006225FALSE 2006225\2006225FALSE
Aucun commentaire:
Enregistrer un commentaire