Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
14 years ago

strange intermittent error message

An exception occurred in the "commonlibrary" unit at line 684:

The object invoked chose not to process the call now.  Try again later



I have written a manual checkpoint that compares values in a TrueDBGrid with the expected values. To do this I loop through the grid. (I love ActiveX.)



  bFound = false

  For i = 0 to Ubound(asTests)

    grdTests.MoveFirst

    Do While Not grdTests.EOF

      If UCase(grdTests.Columns(0).Text) = UCase(asTests(i)) Then

        bFound = true

        Exit Do        

      end if  

      grdTests.MoveNext

    Loop

    If Not bFound Then   ' If one test is not found, then the whole checkpoint fails.

      bSuccess = false

      Exit For  

    end if                

  Next   





I have an array of expected values. I intermittently get this error on the MoveFirst method call. This makes for a fairly brittle test. It makes me sad! (joking around a bit.) Anyone have any thoughts?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Is it possible that, when you get to that MoveFirst call, that the grid isn't fully done processing the requests and population of data?  It could be that it is "busy" with something when you send "MoveFirst" and, therefore, can't proceed.



    Try tossing in a delay before that and see if slowing down the test a bit helps this.  If so, you might want to check to see if the grid has some property that indicates it is "done loading" or something.