Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default differentiate empty and zero

I have the following situation:
An Interbase table with integer and string fields.

Then the following code fragment:

Dim rs As ADODB.Recordset
Dim strQuery As String
Dim arrData

strQuery = "SELECT G.* FROM GPP_INVESTIGATION G WHERE G.ENTRY_ID = " &
lENTRY

Set rs = New ADODB.Recordset

rs.Open Source:=strQuery, _
ActiveConnection:=ADOConn, _
CursorType:=adOpenForwardOnly, _
LockType:=adLockReadOnly, _
Options:=adCmdText

arrData = rs.GetRows

Now I need to know if elements in this array are empty or zero. The problem
is that I can't find a way to
differentiate between these two.
Thanks for any advice on this.


RBS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default differentiate empty and zero

"RB Smissaert" wrote ...

I have the following situation:
An Interbase table with integer and string fields.

Then the following code fragment:

Dim rs As ADODB.Recordset
Dim strQuery As String
Dim arrData

strQuery = "SELECT G.* FROM GPP_INVESTIGATION G WHERE G.ENTRY_ID = " &
lENTRY

Set rs = New ADODB.Recordset

rs.Open Source:=strQuery, _
ActiveConnection:=ADOConn, _
CursorType:=adOpenForwardOnly, _
LockType:=adLockReadOnly, _
Options:=adCmdText

arrData = rs.GetRows

Now I need to know if elements in this array are empty or zero.


In the Immediate Window:

a = Array(0,Null)
? IsNull(a(0))
False
? IsNull(a(1))
True

BTW why are you operating on the array and not the recordset? You risk
the values changing due to Excel's/VBA's habit of coercing values.

Jamie.

--
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default differentiate empty and zero

That is a good thought. I am just more used to work with arrays than
recordsets.
Will see.

RBS

"Jamie Collins" wrote in message
om...
"RB Smissaert" wrote ...

I have the following situation:
An Interbase table with integer and string fields.

Then the following code fragment:

Dim rs As ADODB.Recordset
Dim strQuery As String
Dim arrData

strQuery = "SELECT G.* FROM GPP_INVESTIGATION G WHERE G.ENTRY_ID = "
&
lENTRY

Set rs = New ADODB.Recordset

rs.Open Source:=strQuery, _
ActiveConnection:=ADOConn, _
CursorType:=adOpenForwardOnly, _
LockType:=adLockReadOnly, _
Options:=adCmdText

arrData = rs.GetRows

Now I need to know if elements in this array are empty or zero.


In the Immediate Window:

a = Array(0,Null)
? IsNull(a(0))
False
? IsNull(a(1))
True

BTW why are you operating on the array and not the recordset? You risk
the values changing due to Excel's/VBA's habit of coercing values.

Jamie.

--


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
How to differentiate groups of numbers RodJ Excel Worksheet Functions 6 September 25th 08 08:24 AM
How do I differentiate between duplicate ranks? Pez Excel Worksheet Functions 1 March 27th 06 12:12 AM
Differentiate b/w False and 0 with InputBox fn Marcotte A[_2_] Excel Programming 3 June 8th 04 05:10 PM
Differentiate between cell colours gav meredith Excel Programming 2 April 28th 04 05:06 AM
Differentiate between "" and Empty in array elements. RB Smissaert Excel Programming 3 January 2nd 04 09:01 PM


All times are GMT +1. The time now is 03:14 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"