473,785 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Cr eateObject("ado db.connection")
dConn.open application("St rConRuta")
Set dRs=dConn.Execu te("select * from solicitud_canje _gte_temp where
rut='"&session( "Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
Response.Write( "<tr align='center' bgcolor='#CCCCC C' >")
Response.Write( "<td colspan='6' class='txtTable Estilo6' >Canjes Mes
"&nombremes(mon th(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&oacut e;digo</strong></div></td>")
Response.Write( "<td width='29%' class='txtTable '><div
align='center'> <strong>Product o</strong></div></td>")
Response.Write( "<td class='txtTable '><div
align='center'> <strong>Punto s</strong></div></td>")
Response.Write( "<td class='txtTable ' ><div
align='center'> <strong>Cantida d</strong></div></td>")
Response.Write( "<td class='txtTable ' ><div
align='center'> <strong>Objetiv o</strong></div></td>")
Response.Write( "</tr>")
VFech=dRs("fech a")
* Do until month(dRs("Fech a"))<>month(VFe ch) (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_pro ducto")&"</td>") Response.Write( "<td width='30%' align='center' class='txtTable '"&dRs("descrip cion")&"</td>") Response.Write( "<td width='10%' align='center' class='txtTable '"&dRs("puntos" )&"</td>") Response.Write( "<td width='10%' align='center' class='txtTable '"&dRs("cantida d")&"</td>")

Response.Write( "<td width='30%'
class='txtTable '>"&dRs("objeti vo")&"</td>")
Response.Write( "</tr>")
Total=cint(Tota l+cint(dRs("pun tos")))
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'><"&for matnumber(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(Tot alG+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 1532
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("Fech a"))<>month(VFe ch)
...
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.Execu te(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.c l> escribió en el mensaje
news:P6******** *********@jagge r.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.Cr eateObject("ado db.connection")
dConn.open application("St rConRuta")
Set dRs=dConn.Execu te("select * from solicitud_canje _gte_temp where
rut='"&session( "Rut")&"' ORDER BY month(fecha)")
do until dRs.eof
Response.Write( "<tr align='center' bgcolor='#CCCCC C' >")
Response.Write( "<td colspan='6' class='txtTable Estilo6' >Canjes Mes
"&nombremes(mon th(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&oacut e;digo</strong></div></td>")
Response.Write( "<td width='29%' class='txtTable '><div
align='center'> <strong>Product o</strong></div></td>")
Response.Write( "<td class='txtTable '><div
align='center'> <strong>Punto s</strong></div></td>")
Response.Write( "<td class='txtTable ' ><div
align='center'> <strong>Cantida d</strong></div></td>")
Response.Write( "<td class='txtTable ' ><div
align='center'> <strong>Objetiv o</strong></div></td>")
Response.Write( "</tr>")
VFech=dRs("fech a")
* Do until month(dRs("Fech a"))<>month(VFe ch) (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_pro ducto")&"</td>") Response.Write( "<td width='30%' align='center' class='txtTable '
"&dRs("descrip cion")&"</td>")

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

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

Response.Write( "<td width='30%'
class='txtTable '>"&dRs("objeti vo")&"</td>")
Response.Write( "</tr>")
Total=cint(Tota l+cint(dRs("pun tos")))
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'><"&for matnumber(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(Tot alG+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.Execu te("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("Fech a"))<>month(VFe ch) (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(VFe ch))

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******@NOyah oo.SPAMcom> escribió en el mensaje
news:e5******** ******@TK2MSFTN GP12.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.Execu te("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("Fech a"))<>month(VFe ch) (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(VFe ch))

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("Fech a"))?
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******@NOyah oo.SPAMcom> escribió en el mensaje
news:e5******** ******@TK2MSFTN GP12.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.Execu te("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("Fech a"))<>month(VFe ch) (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(VFe ch))

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******@NOyah oo.SPAMcom> escribió en el mensaje
news:e5******** ******@TK2MSFTN GP12.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.Execu te("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("Fech a"))<>month(VFe ch) (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(VFe ch))

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******@NOyah oo.SPAMcom> escribió en el mensaje
news:e5******** ******@TK2MSFTN GP12.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.Execu te("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("Fech a"))<>month(VFe ch) (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(VFe ch))

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******@NOyah oo.SPAMcom> escribió en el mensaje
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
What about month(dRs("Fech a"))?
Are there any records where dRs("Fecha") is Null or empty?

No any one.
Jul 22 '05 #9

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

No any one.
Jul 22 '05 #10

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

Similar topics

6
2342
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 assemblies are loaded before shutting down. In one case, some of my DB-accessing code didn't handle a NULL value properly. But try...catch wouldn't catch the exception and keep going. I'd just get the error message and then it would shut the...
7
2705
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 Java)? or do you have to create your own exceptions and make your own error-messages? I would only need the error-number or something like a short description which exception occured, and subsequently I want to write it to a logfile.
44
4229
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 user tasks should always be included in a try/catch block that actually handles any exceptions that occur (log the exception, display a message box, etc.). 2. Low-level operations that are used to carry out the high level tasks
40
13536
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
3
1856
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 a mehtod called ExceptionGenerator that will generate a run-time exception. The exception is caught in GenericGridEvent, but it isn't caught in InitializeComponenet (which doens't suprise me). I can't figure out where to catch an error that may...
5
3437
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 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide some common functionality. The Page_Load handler the failing webpage starts out like this: ...
9
2210
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 AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledException Application.Run(Main)
132
5620
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 hard-to-find bugs. http://distributed-software.blogspot.com/2007/01/c-exception-handling-is-defective.html Regards, zorabi@ZHMicro.com http://www.zhmicro.com http://distributed-software.blogspot.com
2
6993
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: parseMetadata.obj : error LNK2001: unresolved external symbol "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) 2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol "public: __thiscall...
3
2042
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 testing though and as soon as I have a root cause to the problem I'll be sure to let the list know.
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.