...

type mismatch with NULL

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

Kiwi
03-03-2005, 04:10 AM
Doesn't VB use an IsNull function...

if IsNull(rst(i).value) then
...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum