View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
FlaviusFlav FlaviusFlav is offline
external usenet poster
 
Posts: 1
Default How to handle null numeric values in ADO recordset

I am currently working on some code that populates a spreadsheet wit
data obtained from a servlet that returns an ADO object. The code work
ok except for the case when the object contains 'empty' numeri
values.

The object returned is something like :

<?xml version="1.0" encoding="UTF-8"?
...
<s:datatype rs:maybenull="true" *dt:type="float"
maxLength="20" /
</s:AttributeType

<s:extends type="rs:rowbase" /
</s:ElementType
</s:Schema
<rs:data
<z:row INDEX="2004-04-05" x="1" /
<z:row INDEX="2004-04-06" x="2" /
<z:row INDEX="2004-04-07" x="3" /
<z:row INDEX="2004-04-08" x="4" /
*<z:row INDEX="2004-04-09" x="" /*
<z:row INDEX="2004-04-12" x="6" /
<z:row INDEX="2004-04-13" x="7" /
<z:row INDEX="2004-04-14" x.="8" /
<z:row INDEX="2004-04-15" x.="9" /
<z:row INDEX="2004-04-16" x="10" /
</rs:data
</xml

The error I get when it fails is:
Run-time error '-2147467259 (80004005)':
Data provider or other service returned an E_FAIL status.

and comes from this line:
Application.ActiveSheet.Cells(Application.ActiveCe ll.Row + 1
Application.ActiveCell.Column).CopyFromRecordset rs

I've been battling with this for some time now, and I'm not sure how t
get around this. It also works ok if I tweak it so that the data typ
of the column returned is string. Then the empty-string null i
handled ok.

I assume there must be a way to handle this with VBA, but for the lif
of me, I haven't been able to figure out.

If anybody has any idea here, I would GREATLY appreiate the help. TI

--
Message posted from http://www.ExcelForum.com