Type mismatch error

rag84dec's Avatar, Join Date: Jul 2007
Go4Expert Member
I am assiging a the count(*) from a database query to a variable.But it is giving this error
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
the query is here
sql="select count(*) from tablename where row=somevalue "
set ObjRS=cn.execute(sql)
dim variable

if variable <> 0 then 'Here i am getting an error mentioned 'above
end if
dotnetexpert's Avatar
Light Poster
try below mentione query. cheers..

" select isnull(count(1),0) from tablename where row=somevalue "