Hello,
I'm trying to extract information from a query and create a XML file. No problem with that. My script is working perfectly (and thanks to helpers here on this forum).
There is a bunch of fields that I don't want to show as there are empty of value. Fields are (0) or (1) or (2), (0) being the last solution if (1) and (2) are empty.
Basically here is my logic:
if (1) is empty then
if (2) is empty then
line to display value (0)
else
line to display value (2)
else
line to display value (1)
end if
(or = if...then...elseif...then...else...end if)
Here is my code:
Problem: it is sending to my XML only the lines Fields(2) (called RRN). Even if there are empty.
tip to understand: as you may know when a field value is empty/null, XML protocol convert the value as a "Null" value instead of skiping it.
Like this: "<DEBTOR_RRN_NUMBER>Null</DEBTOR_RRN_NUMBER>"
help help help :/
Many thanks in advance
Chris
I'm trying to extract information from a query and create a XML file. No problem with that. My script is working perfectly (and thanks to helpers here on this forum).
There is a bunch of fields that I don't want to show as there are empty of value. Fields are (0) or (1) or (2), (0) being the last solution if (1) and (2) are empty.
Basically here is my logic:
if (1) is empty then
if (2) is empty then
line to display value (0)
else
line to display value (2)
else
line to display value (1)
end if
(or = if...then...elseif...then...else...end if)
Here is my code:
Code:
If rs.Fields(1).Value = "Null" Then 'check if RRN is empty
Print #1, "<"; rs.Fields(2).Name; ">"; rs.Fields(2).Value; "</"; rs.Fields(2).Name; ">"
ElseIf rs.Fields(2).Value = "Null" Then 'check if KBO is empty
Print #1, "<"; rs.Fields(0).Name; ">"; rs.Fields(0).Value; "</"; rs.Fields(0).Name; ">"
Else
Print #1, "<"; rs.Fields(1).Name; ">"; rs.Fields(1).Value; "</"; rs.Fields(1).Name; ">"
End If
Problem: it is sending to my XML only the lines Fields(2) (called RRN). Even if there are empty.
tip to understand: as you may know when a field value is empty/null, XML protocol convert the value as a "Null" value instead of skiping it.
Like this: "<DEBTOR_RRN_NUMBER>Null</DEBTOR_RRN_NUMBER>"
help help help :/
Many thanks in advance
Chris