NancyJ
03-02-2005, 01:15 PM
I'm having a problem checking for a null value in a recordset pulled from an SQL Server Database.
I get a type mismatch error on the if statement.
strSQL = "SELECT * FROM events WHERE UID = 406"
set rst = con.execute(strSQL)
for i = 0 to rst.fields.count - 1
if rst(i).value = NULL then
execute(rst(i).name & "=" & cstr(chr(34)&" "&chr(34)))
else
execute(rst(i).name & "=" & cstr(chr(34)&cstr(rst(i).value)&chr(34)))
end if
next
rst.close
I get a type mismatch error on the if statement.
strSQL = "SELECT * FROM events WHERE UID = 406"
set rst = con.execute(strSQL)
for i = 0 to rst.fields.count - 1
if rst(i).value = NULL then
execute(rst(i).name & "=" & cstr(chr(34)&" "&chr(34)))
else
execute(rst(i).name & "=" & cstr(chr(34)&cstr(rst(i).value)&chr(34)))
end if
next
rst.close