Forum Discussion

zunaira's avatar
zunaira
Occasional Contributor
10 years ago

object required Exception while creating DB connection

dear members,

 

i have Object required exception when tried to get RecSet object 

 

Set RecSet = AConnection.Execute_("SELECT * from Program")
Log.Message(RecSet.RecordCount)
Set getProgramCount=RecSet.RecordCount

when i log this RecordCount it give me right answer but when i tried to have the same count in getProgramCount varriable it is giving me object required exception on RecSet .

 

kindly help me why is this so..

 

Urgnent Help will appreciated .

  • Hi Zunaira,

     

    There is no need to use SET in this line:

    SET getProgramCount=RecSet.RecordCount

     

    The RecordCount property doesn’t return a value (not an object). Here is the modified line:

    getProgramCount=RecSet.RecordCount
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Zunaira,

     

    There is no need to use SET in this line:

    SET getProgramCount=RecSet.RecordCount

     

    The RecordCount property doesn’t return a value (not an object). Here is the modified line:

    getProgramCount=RecSet.RecordCount