divisible by zero error in ADO

by Andrew Browne <abrowne(at)pbm.co.za>

 Date:  Wed, 11 Apr 2001 15:27:05 +0200
 To:  "'hwg-languages(at)hwg.org'" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hi

I have the following test procedure in SQL Server 6.5 where a division =
by zero would occur if the "set ARITHIGNORE on" had not been included.  =
When run in isql, the last value is returned as null.  However, when run =
via an asp page, ADO still returns the divisble by zero error even =
though the procedure is returning a null.  Does anyone have an =
explanation or work-around for this (I could modify the real procedure =
but it would become very inefficient).
ERROR MESAGE IN IE5
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'=20
[Microsoft][ODBC SQL Server Driver][SQL Server]Divide by zero error =
encountered=20
/programs/testDivZero.asp, line 20=20
PROCEDURE
create procedure DivZeroError
as
set ARITHIGNORE on  -- we know there will be some divide by zero =
errors...
select 1,2,3,4,10/2,6/0
go
ASP PAGE
<HTML>
<HEAD>
<TITLE>TestDivZero</TITLE>
</HEAD>

<SCRIPT>
<!--#INCLUDE FILE=3D"../adovbs.inc"-->
</SCRIPT>

<%
  Set AdoCommand =3D Server.CreateObject("ADODB.Command")
  Set AdoCommand.ActiveConnection =3D Session("Conn")

  Set RS1 	   =3D Server.CreateObject("ADODB.RecordSet")

  SQL =3D "DivZeroError"
  AdoCommand.CommandText=3DSQL
  RS1.MaxRecords =3D 10
  RS1.CursorLocation =3D adUseClient
  RS1.open AdoCommand

%>
____________________________
Andrew Browne
Web application developer
PBM/Medscheme Integrated Care IT
Belmont Park, Rondebosch
021 - 658 6484
abrowne(at)pbm.co.za
____________________________

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.