469,323 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

error '800a040e'

Hi,
the enclosed code loops through a recordset for time and date. and printing out
name and volym if certan conditions are met.
<%
dat = ""
tp = ""
vt = 0
et = 0
vd = 0
de = 0
Do While Not rs1.EOF
If dat <> CDate(rs1("Dag")) then
If tp <> CDate(rs1("tidpunkt")) then
if not tp = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right >"
Response.Write "<B><U>Givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right>"
Response.Write "<B><U>Energi</U></B></TD></TD>"
Response.Write "<TD>" & et & "</TD></TR>"
end if
If not dat = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right >"
Response.Write "<B><U>Under dygnet givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right>"
Response.Write "<B><U>Energi givet under dygnet</U></B></TD></TD>"
Response.Write "<TD>" & de & "</TD></TR>"
end if

dat = CDate(rs1("Dag"))
vt = cint(rs1("Volym"))
et = cint(rs1("Energi"))
tp = CDate(rs1("tidpunkt"))
Response.Write "<TR><TD>" & CDate(rs1("Dag"))& "</TD>"
Response.Write "<TD>" & CDate(rs1("tidpunkt"))& "</TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD></TR>"
Else
vt = vt + cint(rs1("Volym"))
et = et + cint(rs1("Energi"))
Response.Write "<TR><TD>&nbsp;</TD>"
Response.Write"<TD>&nbsp;</TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD></TR>"
End If
Else
vd = vt + vt
de = de + de
rs1.MoveNext
Loop
if not tp = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right >"
Response.Write "<B><U>Givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 4 Align = right>"
Response.Write "<B><U>Energi</U></B></TD></TD>"
Response.Write "<TD>" & et & "</TD></TR>"
end if
If not dat = "" then
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right >"
Response.Write "<B><U>Under dygnet givet volym</U></B></TD>"
Response.Write "<TD>" & vt & "</TD></TR>"
Response.Write "<TR>"
Response.Write "<TD COLSPAN = 5 Align = right>"
Response.Write "<B><U>Energi givet under dygnet</U></B></TD></TD>"
Response.Write "<TD>" & de & "</TD></TR>"
end if
vbalans.Close
Set vbalans = Nothing
%>

I keeping geting:

Microsoft VBScript compilation error '800a040e'

'loop' without 'do'

/vatskebalans/visa_rapporten102.asp, line 87

Loop
^

Please help me out
Yours
Peter
Jul 19 '05 #1
2 4959
PeterL wrote on 10 mei 2004 in microsoft.public.inetserver.asp.general:
'loop' without 'do'


your if-then-[else]-end-if's are not ended before the loop

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Thanks 4 your answer and help
Now that it works I se more problems - I hope you can help me with
this even though the page is in swedish
1)Not al post shows i.e if hou visit the page
http://www12.brinkster.com/vatskebalans/count.asp and mark "Elvansson"
then you see
a) for 040321 there is 5 posts for time 00:00
b)for 040603 there´s in the database 2 posts 14:42, 1 post kl 00:00
and 1 post kl 14:20

c) "Energi givet under dygnet" = de in my code doesn´t give the right
answer -something wrong with my formula

2) for the others on that page I keep getting error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'CDate'
/vatskebalans/visa_rapporten102.asp, line 45

and line 45 = If tp <> CDate(rs1("tidpunkt")) then
please help me out with my problems

Thx in advance
/Peter
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Tony Wright | last post: by
1 post views Thread by Aravind | last post: by
1 post views Thread by yanwan | last post: by
5 posts views Thread by Enos Meroka | last post: by
7 posts views Thread by p | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.