Type mismatch error

Discussion in 'ASP' started by rag84dec, Apr 20, 2008.

  1. rag84dec

    rag84dec New Member

    Joined:
    Jul 17, 2007
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    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
    
     
  2. dotnetexpert

    dotnetexpert New Member

    Joined:
    May 16, 2008
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    try below mentione query. cheers..

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice