LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TO DELETE ONLY NUMERIC VALUES IN A CHARACTER AND NUMERIC CELL IN ramesh k. goyal - abohar[_2_] Excel Discussion (Misc queries) 1 October 28th 09 06:50 AM
Showing NULL Command Bar handle [email protected] Excel Discussion (Misc queries) 0 June 4th 07 11:40 AM
Handle missing values Arne Hegefors Charts and Charting in Excel 1 May 8th 07 01:15 PM
Return Numeric Labels that have different Numeric Values Sam via OfficeKB.com Excel Worksheet Functions 8 December 3rd 06 02:06 AM
Creating small "recordset" or sorting a numeric 1-dim array Anthony Cravero Excel Programming 0 December 19th 03 06:36 PM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"