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