473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Exception error

Gentlemen a warm greeting of New Year, that everything is happy next to
their dear family and beings. Now to the subject, I have an error of
exception in this subroutine. The error is:(0x80020009)
A data base is SQL Server 2000.
**********************************
Sub Desplegar (Mes)
Set dConn=Server.CreateObject("adodb.connection")
dConn.open application("StrConRuta")
Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp where
rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
Response.Write("<tr align='center' bgcolor='#CCCCCC' >")
Response.Write("<td colspan='6' class='txtTable Estilo6' >Canjes Mes
"&nombremes(month(dRs("fecha")))&"</td>")
Response.Write("</tr>")
Response.Write("<tr align='center'>")
Response.Write("<td width='13%' class='txtTable' ><div
align='center'><strong>Fecha Canje </strong></div></td>")
Response.Write("<td width='7%' class='txtTable'><div
align='center'><strong>C&oacute;digo</strong></div></td>")
Response.Write("<td width='29%' class='txtTable'><div
align='center'><strong>Producto</strong></div></td>")
Response.Write("<td class='txtTable'><div
align='center'><strong>Puntos</strong></div></td>")
Response.Write("<td class='txtTable' ><div
align='center'><strong>Cantidad</strong></div></td>")
Response.Write("<td class='txtTable' ><div
align='center'><strong>Objetivo</strong></div></td>")
Response.Write("</tr>")
VFech=dRs("fecha")
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error) (0x80020009)
Response.Write("<tr> ")
Response.Write("<td width='10%' class='txtTable'>"&dRs("fecha")&"</td>")
Response.Write("<td width='10%' align='center' class='txtTable'
"&dRs("cod_producto")&"</td>") Response.Write("<td width='30%' align='center' class='txtTable'"&dRs("descripcion")&"</td>") Response.Write("<td width='10%' align='center' class='txtTable'"&dRs("puntos")&"</td>") Response.Write("<td width='10%' align='center' class='txtTable'"&dRs("cantidad")&"</td>")

Response.Write("<td width='30%'
class='txtTable'>"&dRs("objetivo")&"</td>")
Response.Write("</tr>")
Total=cint(Total+cint(dRs("puntos")))
dRs.MoveNext
Loop
Response.Write("<tr align='center' class='txt'><td height='22' colspan='3'
align='center' class='txtTable'><div
align='center'><strong>Sub-Total</strong><font size='2'></font>
</div></td><td width='10%' class='TxtTable'><div align='center'><font
size='2'><"&formatnumber(Total,0,,,-2)&"</font></div><td width='14%'
align='right' class='txtTable'><div align='center'><font size='2'></font>
</div></td><td width='27%' class='txtTable'><div align='center'><font
size='2'></font></div></td></tr>")
dRs.MoveNext
TotalG=cint(TotalG+cint(Total))
loop
End Sub

**********************************
This sub routine loads in a pagina a iforme ordered per month. Please help
me
Thanks
--
Marco Antonio Artus S.
Lakromsoft INC.
09-9594663
Jul 22 '05 #1
12 1507
Lakrom wrote:
Gentlemen a warm greeting of New Year, that everything is happy next
to their dear family and beings. Now to the subject, I have an error
of exception in this subroutine. The error is:(0x80020009)


You need to verify that your query returned any records before you attempt
to read the values of any fields in your recordset. You do this using the
EOF property.

'open the recordset, then

if not dRS.EOF then
Do until month(dRs("Fecha"))<>month(VFech)
...
else
Response.Write "No records were returned
end if

You can debug your query by printing it out. Assign the sql statement to a
variable instead of executing it directly:

dim sSQL
sSQL = "select * from solicitud_canje_gte_temp where " & _
"rut='"&session("Rut")&"' ORDER BY month(fecha)".

Response.Write sSQL

Set dRs=dConn.Execute(sSQL,,1)
....
Look at the statement that gets written to the browser window when you run
the page and verify that it is a valid sql statement that looks the way you
expect it to look.

Bob Barrows
..
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #2
Thanks but already I have proven that the registry does not come vacio, I
have done it with Response.Write(dRs("fecha")) and Response.End() asi that I
believe that the exception must be of another side.
"Lakrom" <la****@terra.cl> escribió en el mensaje
news:P6*****************@jagger.tie.cl...
Gentlemen a warm greeting of New Year, that everything is happy next to
their dear family and beings. Now to the subject, I have an error of
exception in this subroutine. The error is:(0x80020009)
A data base is SQL Server 2000.
**********************************
Sub Desplegar (Mes)
Set dConn=Server.CreateObject("adodb.connection")
dConn.open application("StrConRuta")
Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp where
rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
Response.Write("<tr align='center' bgcolor='#CCCCCC' >")
Response.Write("<td colspan='6' class='txtTable Estilo6' >Canjes Mes
"&nombremes(month(dRs("fecha")))&"</td>")
Response.Write("</tr>")
Response.Write("<tr align='center'>")
Response.Write("<td width='13%' class='txtTable' ><div
align='center'><strong>Fecha Canje </strong></div></td>")
Response.Write("<td width='7%' class='txtTable'><div
align='center'><strong>C&oacute;digo</strong></div></td>")
Response.Write("<td width='29%' class='txtTable'><div
align='center'><strong>Producto</strong></div></td>")
Response.Write("<td class='txtTable'><div
align='center'><strong>Puntos</strong></div></td>")
Response.Write("<td class='txtTable' ><div
align='center'><strong>Cantidad</strong></div></td>")
Response.Write("<td class='txtTable' ><div
align='center'><strong>Objetivo</strong></div></td>")
Response.Write("</tr>")
VFech=dRs("fecha")
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error) (0x80020009)
Response.Write("<tr> ")
Response.Write("<td width='10%' class='txtTable'>"&dRs("fecha")&"</td>") Response.Write("<td width='10%' align='center' class='txtTable'
"&dRs("cod_producto")&"</td>") Response.Write("<td width='30%' align='center' class='txtTable'
"&dRs("descripcion")&"</td>")

Response.Write("<td width='10%' align='center' class='txtTable'
"&dRs("puntos")&"</td>")

Response.Write("<td width='10%' align='center' class='txtTable'
"&dRs("cantidad")&"</td>")

Response.Write("<td width='30%'
class='txtTable'>"&dRs("objetivo")&"</td>")
Response.Write("</tr>")
Total=cint(Total+cint(dRs("puntos")))
dRs.MoveNext
Loop
Response.Write("<tr align='center' class='txt'><td height='22'

colspan='3' align='center' class='txtTable'><div
align='center'><strong>Sub-Total</strong><font size='2'></font>
</div></td><td width='10%' class='TxtTable'><div align='center'><font
size='2'><"&formatnumber(Total,0,,,-2)&"</font></div><td width='14%'
align='right' class='txtTable'><div align='center'><font size='2'></font>
</div></td><td width='27%' class='txtTable'><div align='center'><font
size='2'></font></div></td></tr>")
dRs.MoveNext
TotalG=cint(TotalG+cint(Total))
loop
End Sub

**********************************
This sub routine loads in a pagina a iforme ordered per month. Please help
me
Thanks
--
Marco Antonio Artus S.
Lakromsoft INC.
09-9594663

Jul 22 '05 #3
Please reply to and include a quote from the message to which you are
replying. You do not have to quote the whole message, in fact, it is best to
trim the parts of the message which are not relevant, as I will do below.

Lakrom wrote:
Thanks but already I have proven that the registry does not come
vacio, I have done it with Response.Write(dRs("fecha")) and
Response.End() asi that I believe that the exception must be of
another side.

Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp where
rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
I did miss this line. OK, your recordset contains records.
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error)
(0x80020009)


What happens if you simply do

Response.Write month(VFech)

? Are you certain VFech contains a valid date? If you get an error, try
explicitly converting it to a date using CDate:

Response.Write month(CDate(VFech))

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #4
Yes this line Response.Write month(VFech) contains a valid date and prove to
with CDate function and is the same error.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:e5**************@TK2MSFTNGP12.phx.gbl...
Please reply to and include a quote from the message to which you are
replying. You do not have to quote the whole message, in fact, it is best to trim the parts of the message which are not relevant, as I will do below.

Lakrom wrote:
Thanks but already I have proven that the registry does not come
vacio, I have done it with Response.Write(dRs("fecha")) and
Response.End() asi that I believe that the exception must be of
another side.

Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp where
rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
I did miss this line. OK, your recordset contains records.
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error)
(0x80020009)


What happens if you simply do

Response.Write month(VFech)

? Are you certain VFech contains a valid date? If you get an error, try
explicitly converting it to a date using CDate:

Response.Write month(CDate(VFech))

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #5
What about month(dRs("Fecha"))?
Are there any records where dRs("Fecha") is Null or empty?

Bob Barrows

Response.Write
Lakrom wrote:
Yes this line Response.Write month(VFech) contains a valid date and
prove to with CDate function and is the same error.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:e5**************@TK2MSFTNGP12.phx.gbl...
Please reply to and include a quote from the message to which you are
replying. You do not have to quote the whole message, in fact, it is
best to trim the parts of the message which are not relevant, as I
will do below.

Lakrom wrote:
Thanks but already I have proven that the registry does not come
vacio, I have done it with Response.Write(dRs("fecha")) and
Response.End() asi that I believe that the exception must be of
another side.

Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp
where rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof


I did miss this line. OK, your recordset contains records.
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error)
(0x80020009)


What happens if you simply do

Response.Write month(VFech)

? Are you certain VFech contains a valid date? If you get an error,
try explicitly converting it to a date using CDate:

Response.Write month(CDate(VFech))

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #6
Yes this line Response.Write month(VFech) contains a valid date and prove to
with CDate function and is the same error.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:e5**************@TK2MSFTNGP12.phx.gbl...
Please reply to and include a quote from the message to which you are
replying. You do not have to quote the whole message, in fact, it is best to trim the parts of the message which are not relevant, as I will do below.

Lakrom wrote:
Thanks but already I have proven that the registry does not come
vacio, I have done it with Response.Write(dRs("fecha")) and
Response.End() asi that I believe that the exception must be of
another side.

Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp where
rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
I did miss this line. OK, your recordset contains records.
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error)
(0x80020009)


What happens if you simply do

Response.Write month(VFech)

? Are you certain VFech contains a valid date? If you get an error, try
explicitly converting it to a date using CDate:

Response.Write month(CDate(VFech))

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #7
Yes this line Response.Write month(VFech) contains a valid date and prove to
with CDate function and is the same error.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:e5**************@TK2MSFTNGP12.phx.gbl...
Please reply to and include a quote from the message to which you are
replying. You do not have to quote the whole message, in fact, it is best to trim the parts of the message which are not relevant, as I will do below.

Lakrom wrote:
Thanks but already I have proven that the registry does not come
vacio, I have done it with Response.Write(dRs("fecha")) and
Response.End() asi that I believe that the exception must be of
another side.

Set dRs=dConn.Execute("select * from solicitud_canje_gte_temp where
rut='"&session("Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
I did miss this line. OK, your recordset contains records.
* Do until month(dRs("Fecha"))<>month(VFech) (Line of error)
(0x80020009)


What happens if you simply do

Response.Write month(VFech)

? Are you certain VFech contains a valid date? If you get an error, try
explicitly converting it to a date using CDate:

Response.Write month(CDate(VFech))

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #8

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:%2****************@TK2MSFTNGP10.phx.gbl...
What about month(dRs("Fecha"))?
Are there any records where dRs("Fecha") is Null or empty?

No any one.
Jul 22 '05 #9

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:%2****************@TK2MSFTNGP10.phx.gbl...
What about month(dRs("Fecha"))?
Are there any records where dRs("Fecha") is Null or empty?

No any one.
Jul 22 '05 #10
Lakrom wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> escribió en el mensaje
news:%2****************@TK2MSFTNGP10.phx.gbl...
What about month(dRs("Fecha"))?
Are there any records where dRs("Fecha") is Null or empty?

No any one.


Show us the contents of dRs("Fecha")

You are going to need to verify where this error is occurring. The best way
to do that is create a test page with only the code needed to cause the
error. I would start with a page like this:

<%
Set dConn=Server.CreateObject("adodb.connection")
dConn.open application("StrConRuta")
dim sSQL
sSQL = "select * from solicitud_canje_gte_temp where " & _
"rut='"&session("Rut")&"' ORDER BY month(fecha)".

Response.Write sSQL

Set dRs=dConn.Execute(sSQL,,1)

if not dRs.EOF then
Response.Write dRs("Fecha")
Response.Write month(dRs("Fecha"))
end if
dRs.Close:Set dRs=Nothing
dConn.Close: Set dConn=Nothing
%>

Run this page and let us know if an error occurs. If no error occurs, then
the error is being caused by some other line in your code. Add lines from
the failing code one-at-a-time to the test page until you determine te
actual cause of the error, and let us know which one it is.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #11
Lakrom wrote:
The page...


You will be lucky if anyone looks at this. You will be better off creating a
small test page (as I described in my previous messsage) to try to
demonstrate your error rather than expecting somebody to read through all
the code in this page. Frankly, there was too much irrelevant code in your
original post.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #12
io
G'day Lakrom,

To help you out with this it'd be advantegeous if you included the error description as well. As your .asp page falls over it should come up with err description as well as a script line number that cuased the err (this is a default behaviour for MS IIS).

BTW, in the code below it seems that the line VFech=dRs("fecha") should be inside your inner loop rather than outside

...................................
...................................
...................................
Do until VFech<>dRs("Fecha")
Response.Write("<tr> ")
Response.Write("<td width='10%' class='txtTable'>"&dRs("fecha")&"</td>")
Response.Write("<td width='10%' align='center' class='txtTable' >"&dRs("cod_producto")&"</td>")
Response.Write("<td width='30%' align='center' class='txtTable' >"&dRs("descripcion")&"</td>")
Response.Write("<td width='10%' align='center' class='txtTable' >"&dRs("puntos")&"</td>")
Response.Write("<td width='10%' align='center' class='txtTable' >"&dRs("cantidad")&"</td>")
Response.Write("<td width='30%' class='txtTable'>"&dRs("objetivo")&"</td>")
Response.Write("</tr>")
Total=cint(Total+cint(dRs("puntos")))
VFech=dRs("fecha")
dRs.MoveNext
Loop
VFech=dRs("fecha")
...................................
...................................
...................................

Cheers

Jul 22 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Daniel Wilson | last post by:
I am having exception-handling and stability problems with .NET. I will have a block of managed code inside try...catch and will still get a generic ..NET exception box that will tell me which...
7
by: Ekim | last post by:
hy, I've a question concerning exception-handling in c++: is there a possibility to catch any exception (I know one can do that by "catch(...)") and display its default-error-message (like in...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
40
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
3
by: will | last post by:
Hi all. I've got an question about how to catch an exception. In Page_Load, I place a DataGrid, dg1, into edit mode. This will call the method called GenericGridEvent. GenericGridEvent will call...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
9
by: Claudio Di Flumeri | last post by:
Hello all, I've added a global exception handler to my application in this way: Sub Main() AddHandler Application.ThreadException, AddressOf ThreadException AddHandler...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
2
by: Darko Miletic | last post by:
Recently I wrote a dll in c++ and to simplify the distribution I decided to link with multithreaded static library (/MT or /MTd option). In debug everything works fine but in release I get this: ...
3
by: Robert Rawlins | last post by:
Hi Mk, Yeah it's got me a little bemused to be honest, I've tried playing around with configuration options this morning and not been able to achieve anything that works properly. I'll keep...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.