Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Leiria Portugal

    Red face Unanswered: ado data control error in Set adodc1.recordet=nothing

    Hello people It's my fisrt time in this forum, I hope you can help me.
    I'm using a timer that goes every 1 second to a mysql database check new values. and I use ado data controls to do it. I open and close the recordsets as longer as I need to get de information. Bu I wasn't using this
    Set adodc1.recordet=nothing

    and the program crashed passed 8 hours, because I was always getting information from the data base. Now I put that (Set adodc1.recordet=nothing) below adodc1.recordset.close
    but after 5 lines os code I need to open other recordset and as I put Set adodc1.recordet=nothing the program sends me an error message reporting something like object variable or with block not set. my idea is that e closed and reseted de datacontrol and i can't access it. can you help me how to pass this.
    I want use adodc and with Set adodc1.recordet=nothing try to avoid systems fails. I really need to access many times to the database but it eats all the memory. I must avoid it

    Can you help me?

    I'll be very greatfull

  2. #2
    Join Date
    Mar 2004

    Re: ado data control error in Set adodc1.recordet=nothing

    When you set your recordset to nothing you destroy all reference to it. Therefore if you want to open it again you must create a new Recordset Object.

    set adodc1.recordset = new ADODB.recordset

    Then everythinh should work fine.

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts