Forum Discussion

bloodycritic's avatar
bloodycritic
New Contributor
12 years ago

Getting a mismatch type error

I wanted to call a value from database. Though it's regonizing the value but I when I want to fetch the value using dim there is mismatch type error




Set conn = CreateObject("ADODB.Connection")



conn.open "Umang","Username","Pwd"



strSQLQuery = "SQL query"



Set rs = CreateObject("ADODB.Recordset")



rs.Open strSQLQuery, conn, 3, 3



set RS = Conn.Execute("SQL Squery")



RS.MoveFirst



Do Until RS.EOF



'msgbox("Name - " & RS("notp"))



log.Message("OTP - " & RS("notp"))



RS.MoveNext



Loop



Set conn = Nothing



Set rs = Nothing



 



Dim Otp



 



Otp = rs("notp")



 



Sys.Process("iexplore", 2).Page("Url").SetText(aqconvert.VarToStr(Otp))













 


  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Subhasis,


     


    Do you get the error on this line?


    Otp = rs("notp")


     


    It's expected as you've disassociated the object variable from the Recordset object earlier:


    Set rs = Nothing