<%if recset.eof then
response.write "0"
else
if not recset("1") = "" then
counter = counter +1
end if
if not recset("2") = "" then
counter = counter +1
end if
if not recset("3") = "" then
counter = counter +1
end if
if not recset("4") = "" then
counter = counter +1
end if
if not recset("5") = "" then
counter = counter +1
end if
if not recset("6") = "" then
counter = counter +1
end if
if not recset("7") = "" then
counter = counter +1
end if
if not recset("8") = "" then
counter = counter +1
end if
if not recset("9") = "" then
counter = counter +1
end if
if not recset("10") = "" then
counter = counter +1
end if
response.write counter
end if
%>
Du är helt säker på att det inte finns 4 poster som uppfyller villkoret?
Står counter på 0 vid start?
Pröva att lägg in en till rad i scriptbiten:
<%
if recset.eof then
counter = 0
else
counter = 0
For I = 1 to 10
if recset(I) <> "" then
counter = counter +1
end if
Next
end if
response.write counter
%>