Home All Groups Group Topic Archive Search About

Division by Zero Error - Help Urgent

Author
19 Oct 2005 2:50 AM
swami
Hi All,
I'm getting a weird problem..
This happens only on ONE desktop... Other PC's the same works fine
without any problem..

Here is the problem.

strSQL=  "select max(last_edit_date) from TABLE1"

Dim rsrec As New ADODB.Recordset
       rsrec.Open strSQL, conn, adOpenStatic, adLockOptimistic,
adCmdText

I'm getting Division By Zero error At recordset.open!!!

There is no problem with conn (Connection ) object...


The same rsrec.open works fine with other PC's.. This one I'm getting
in Only ONE PC!!!

Can some one help me to identify what's wrong with this PC?? or what
wrong I'm doing...

Thanks in Advance,
Swami

Author
19 Oct 2005 3:22 AM
Veign
What is max(last_edit_date) when it fails.  Is it Null?

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


<sw***@nucleussoftware.com.sg> wrote in message
Show quoteHide quote
news:1129690213.076549.322890@o13g2000cwo.googlegroups.com...
> Hi All,
> I'm getting a weird problem..
> This happens only on ONE desktop... Other PC's the same works fine
> without any problem..
>
> Here is the problem.
>
> strSQL=  "select max(last_edit_date) from TABLE1"
>
> Dim rsrec As New ADODB.Recordset
>       rsrec.Open strSQL, conn, adOpenStatic, adLockOptimistic,
> adCmdText
>
> I'm getting Division By Zero error At recordset.open!!!
>
> There is no problem with conn (Connection ) object...
>
>
> The same rsrec.open works fine with other PC's.. This one I'm getting
> in Only ONE PC!!!
>
> Can some one help me to identify what's wrong with this PC?? or what
> wrong I'm doing...
>
> Thanks in Advance,
> Swami
>
Author
19 Oct 2005 4:59 AM
swami
Hi Veign,
Thanks For the reply.
Well Even if query fails, or if the returned value is null...
I should not be getting "Division By Zero" Error.
The same query works well in Other System...
Any possible configuration/ installations I need to check in this
particular ERR PC??

Thanks,
Swami


Veign wrote:
Show quoteHide quote
> What is max(last_edit_date) when it fails.  Is it Null?
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> Veign's Blog
> http://www.veign.com/blog
> --
>
>
> <sw***@nucleussoftware.com.sg> wrote in message
> news:1129690213.076549.322890@o13g2000cwo.googlegroups.com...
> > Hi All,
> > I'm getting a weird problem..
> > This happens only on ONE desktop... Other PC's the same works fine
> > without any problem..
> >
> > Here is the problem.
> >
> > strSQL=  "select max(last_edit_date) from TABLE1"
> >
> > Dim rsrec As New ADODB.Recordset
> >       rsrec.Open strSQL, conn, adOpenStatic, adLockOptimistic,
> > adCmdText
> >
> > I'm getting Division By Zero error At recordset.open!!!
> >
> > There is no problem with conn (Connection ) object...
> >
> >
> > The same rsrec.open works fine with other PC's.. This one I'm getting
> > in Only ONE PC!!!
> >
> > Can some one help me to identify what's wrong with this PC?? or what
> > wrong I'm doing...
> >
> > Thanks in Advance,
> > Swami
> >
Author
19 Oct 2005 6:01 AM
mscir
sw***@nucleussoftware.com.sg wrote:

> Hi All,
> I'm getting a weird problem..
> This happens only on ONE desktop... Other PC's the same works fine
> without any problem..
>
> strSQL=  "select max(last_edit_date) from TABLE1"
> Dim rsrec As New ADODB.Recordset
>  rsrec.Open strSQL, conn, adOpenStatic, adLockOptimistic, adCmdText
<snip>

When I run into problems like this I start changing everything in sight,
one variable at a time, using trial and error to see if I can learn more
about the error.

Did you try different strSQL, e.g. maybe take the max() out, read
everything from the table, stuff like that?

Did you try
Dim rsrec As ADODB.Recordset
Set rsrec = New ADODB.Recordset

Mike
Author
19 Oct 2005 6:13 AM
swami
Hi Mike,
Thanks...
Yes you are right.. we should try all the options out.. but Only
problem is Code is in Production.. And though If I'm able to fix this
by changing the code, It has it's own problem.. like will have to move
the same code to 1000's of other workstations...
Instead what I'm looking is , find the root cause why this is happening
N that too in that particular PC..
May be some mis configuration!! some MDAC version problem..
At any case, as this also affects Vendor reputation.. I've to be double
sure(200%) .. on What configuration I need to modify...

Thanks for the help.. let me know if this is related to any of these..
If I bypass the code..  (the partiular recordset.open) I'm getting Dr
Watson error!!!

Swami
Author
19 Oct 2005 6:32 AM
mscir
sw***@nucleussoftware.com.sg wrote:

<snip>
> If I bypass the code..  (the partiular recordset.open) I'm getting Dr
> Watson error!!!

Show your code and the error message.
Author
19 Oct 2005 12:51 PM
Ralph
<sw***@nucleussoftware.com.sg> wrote in message
Show quoteHide quote
news:1129702400.226567.270820@f14g2000cwb.googlegroups.com...
> Hi Mike,
> Thanks...
> Yes you are right.. we should try all the options out.. but Only
> problem is Code is in Production.. And though If I'm able to fix this
> by changing the code, It has it's own problem.. like will have to move
> the same code to 1000's of other workstations...
> Instead what I'm looking is , find the root cause why this is happening
> N that too in that particular PC..
> May be some mis configuration!! some MDAC version problem..
> At any case, as this also affects Vendor reputation.. I've to be double
> sure(200%) .. on What configuration I need to modify...
>
> Thanks for the help.. let me know if this is related to any of these..
> If I bypass the code..  (the partiular recordset.open) I'm getting Dr
> Watson error!!!
>
> Swami
>

As you have already guessed the "Divide by zero" error itself is bogus.
Divide by zero is the last error (0) on the error stack. The crt's
equivalent of "I have fallen and can't get up". Also, as you noted, an error
occurs even if you don't run the offending code. This almost guarantees it
is an error in a component outside VB itself.

If you are unable to trace the Dr. Watson stack back to the offending
component. Install WinDbg as the JIT debugger. (WinDbg will be easier to
install, and have less impact, than a full development environment.)

Also don't forget to inventory what other applications or services might be
running on the offending PC.

hth
-ralph
Author
19 Oct 2005 6:45 AM
Ben Amada
Hi Swami,

What version of MDAC (ADO) do you have installed on your development machine
and the production machines?  Specifically, is the MDAC version on the
machine you're getting an error on different than the MDAC version installed
on the other machines that are not getting an error?

It's hard to imagine a version conflict would cause this error, but anything
is possible.

Ben
Author
19 Oct 2005 7:10 AM
Someone
Questions:

What DB are you using?
What version?
What ADO version is selected in References in the development machine?
What ADO is the latest version listed in References in the development
machine?


<sw***@nucleussoftware.com.sg> wrote in message
Show quoteHide quote
news:1129690213.076549.322890@o13g2000cwo.googlegroups.com...
> Hi All,
> I'm getting a weird problem..
> This happens only on ONE desktop... Other PC's the same works fine
> without any problem..
>
> Here is the problem.
>
> strSQL=  "select max(last_edit_date) from TABLE1"
>
> Dim rsrec As New ADODB.Recordset
>       rsrec.Open strSQL, conn, adOpenStatic, adLockOptimistic,
> adCmdText
>
> I'm getting Division By Zero error At recordset.open!!!
>
> There is no problem with conn (Connection ) object...
>
>
> The same rsrec.open works fine with other PC's.. This one I'm getting
> in Only ONE PC!!!
>
> Can some one help me to identify what's wrong with this PC?? or what
> wrong I'm doing...
>
> Thanks in Advance,
> Swami
>