Type mismatch error

Go4Expert Member
20Apr2008,14:24   #1
rag84dec's Avatar
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
Light Poster
16May2008,17:26   #2
dotnetexpert's Avatar
try below mentione query. cheers..

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