![]() |
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. |
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! |
All times are GMT +1. The time now is 01:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com