adodb connection to excel: recordset.fields(i).value=null for fields with numeric value 
Author Message
 adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

Dear Guru's,

When I make an ADODBconnection to Excel files with Jet 3.51 and execute a
SQLquery statement to an ADODBrecordset I have the following issue:
If there are numeric values in general cellformat the
recordset.fields(i).value=null. If I make the cellformat=text then the
returned value's aren't NULL.
What is the problem? Should I change some recordset properties?
If yes: what, how?



Mon, 20 Aug 2001 03:00:00 GMT  
 adodb connection to excel: recordset.fields(i).value=null for fields with numeric value
I would guess that the default 'empty' variable for text fields is an empty
string whereas the equivalent for other data types (including general) is
NULL. If you don't know what data type a cell is you can either read it's
format before the content (and handle in different ways) or extract all cell
content as strings (variable = rs.fields("column_title").value & "") and
convert them accordingly within your code.

I hope this helps to some extent.

Mike

Quote:

>Dear Guru's,

>When I make an ADODBconnection to Excel files with Jet 3.51 and execute a
>SQLquery statement to an ADODBrecordset I have the following issue:
>If there are numeric values in general cellformat the
>recordset.fields(i).value=null. If I make the cellformat=text then the
>returned value's aren't NULL.
>What is the problem? Should I change some recordset properties?
>If yes: what, how?



Mon, 20 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

2. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

3. vbscript passing a Memo field from adodb connection returns Null after reading once

4. VB6 ADODB.Recordset.Field = NULL Error

5. VB6 ADODB.Recordset.Field = NULL Error

6. How do I allow NULL value on a required field in disconnected recordset

7. Assigning Null value to field of ADO Recordset

8. doesn't recognize Null value from a field value

9. ADODB.Connection and ADODB.Recordset question

10. ADODB.Connection.Execute VS ADODB.Recordset.Update

11. ADODB.connection & ADODB.Recordset

12. sqlserver adodb recordset problem with empty fields

 

 
Powered by phpBB® Forum Software