danblack30
MIS
I'm getting an error in my array when the database has a null value.
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Split'
/intranet/test/tsrformadmin1.asp, line 706
So I wrote this to substitute a value for any nulls
<%
Dim tempvalue
If (Recordset1("Resolved_by") = null ) Then
tempvalue = "no admin"
else tempvalue = Recordset1("Resolved_by")
response.write tempvalue & "<br>"
End If
%>
<%
Dim MyArray2
MyArray2 = Split(tempvalue, ", ")
For i = 0 TO UBound(MyArray2)
response.write MyArray2(i)
next
%>
I believe I have a problem with "=null" , I never get "no admin" even when I know the value is null.
What's the correct way to write this code to equal a null value?
Thanks,
Dan
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Split'
/intranet/test/tsrformadmin1.asp, line 706
So I wrote this to substitute a value for any nulls
<%
Dim tempvalue
If (Recordset1("Resolved_by") = null ) Then
tempvalue = "no admin"
else tempvalue = Recordset1("Resolved_by")
response.write tempvalue & "<br>"
End If
%>
<%
Dim MyArray2
MyArray2 = Split(tempvalue, ", ")
For i = 0 TO UBound(MyArray2)
response.write MyArray2(i)
next
%>
I believe I have a problem with "=null" , I never get "no admin" even when I know the value is null.
What's the correct way to write this code to equal a null value?
Thanks,
Dan