Type mismatch error

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

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 "