Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default ado problem in excel


Here are a couple of suggestions. If you use the Range.CopyFromRecordset
method to retrieve your data then any Null values will be handled
automatically. If you need to retrieve string values directly, the typical
way to handle that is something like the following:

Dim lValue As Long
If IsNull(rsData.Fields(0).Value) Then
lValue = 0
Else
lValue = rsData.Fields(0).Value
End If

You could also rewrite your SQL statement to replace nulls with zero so that
you don't have the problem to begin with.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Goh Siang Hwee" wrote in message
...
I am facing some problem in ado recordset when i tried to
retrieve data which is numeric and it return null finally.

I change the field datatype to text afterward and reenter,
it seems no problem. but now the there are a lot of data
inserted using the old excel file. It is possible for me
to get the numeric data for excel thru visual basic 6.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ado problem in excel

Hi, thanks Rob. I have solved my problem by using other way. I set the
connection string "Extended Properties" to IMEX=1 and all the problem
solved.

Thanks anyway.
Really appreciate for your help.

Regards,
Goh Siang Hwee

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Problem viewing Excel 2003 Pivot Chart fields in Excel 2007 ronny B Charts and Charting in Excel 1 October 24th 08 10:08 PM
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file BrianL_SF Excel Discussion (Misc queries) 2 October 10th 06 08:27 PM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
Excel 97 chart opened in Excel 2003 - Source Data problem DHunt Charts and Charting in Excel 0 December 6th 04 08:05 PM


All times are GMT +1. The time now is 12:56 AM.

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

About Us

"It's about Microsoft Excel"