vinod,
Thanks for reply back...
I changed the code as you suggest as following ... but same problem happen ..for some crazy reason my problem is get the next record..on the rs.movenext
<%
set rs = CreateObject("ADODB.Recordset")
sql = "select * from hextra where regemp=" & "'1234'"
sql = sql & " and month(data)=" & month(date) & " and year(data)=" & year(date) & " order by data asc"
rs.Open sql,"DSN=cpt",1,3
'on error resume next
do while j <= 30
uio=day(rs("data"))
response.write "<br>" & uio & " - "
response.write j
k=uio-j
if k=0 then
response.write "<br>igual ... " '& j & " - " & uio & " - " & "-->" & rs("data")
else
response.write "<br>diferente ->j=" & j & "->uio=" & uio
end if
rs.movenext
j=j+1
loop
set rs=nothing
set objconn=nothing
%>
it is give me ...
Technical Information (for support personnel)
Error Type:
(0x80020009)
Exception occurred.
/URUTU.ASP, line 9
if I comment the movenext it run but not get the next register(as expected) but if i use the movenext it give the exception...
some fact about the environment is I am using Mysql and the field data is a datetime type ... I was think about some cast problem but as you see it is being saw as interger once i be able to search for 0 result if equal ...
it is the result if i comment the movenext ...
.
.
diferente ->j=16->uio=18
18 - 17
diferente ->j=17->uio=18
18 - 18
igual ...
18 - 19
diferente ->j=19->uio=18
18 - 20
diferente ->j=20->uio=18
.
.
.
Thanks again for your help and support.
Brgds,
Fernando Durier
Quote:
quote:Originally posted by durier
I have an application that is showing problem when i try to movenext register..
The code is the following ..
1<%Dim objConn
2Set objConn = server.CreateObject("ADODB.Connection")
3objConn.Open "cpt"
4sql = "select * from hextra where regemp=" & "'90016/0'"
5' the field data has a date where the event hextra was register
6
7sql = sql & " and month(data)=" & month(date) & " and year(data)=" & year(date) & " order by data asc"
8Set RS = objConn.Execute(sql)
9rs.movefirst
10j=1
11while (j<=30)
12 uio=rs("data")
13 uio=day(uio)
14 if j = uio then
15 response.write "<br>igual ... " & j & " - " & uio & " - " & "-->" & rs("data")
16 else
17 response.write "<br>diferente ->j=" & j & "->uio=" & uio
18 end if
19
20 'rs.movenext
21 j=j+1
22wend
23
24set rs=nothing
27set objconn=nothing
%>
In the line 20 if I uncoment this line and make a rs.movenext
to next register it give me the following answer ...
Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/urutu.asp, line 10
Any ideia what is it happen...
Thx,
|