Antonio has been working with me on the above subject .. I contuinue to get intermittant ADO errors in the setado method of code ..
Here is the thread and some of the suggested fixes .. if anyone would like to add their comments .. please feel free .. this problem still persists .. I have put the try, catch, end try in production this evening .. will wait to see if this problem re-appears
Rick Lipkin
>>>> Antonio Linares 07/21/09 4:53 PM >>>
> Rick,
>
> You may use a TRY ... CATCH to avoid that error:
>
> ::bKeyCount := {|| GetKeyCount( ::oRs ) }
>
> static function GetKeyCount( oRs )
>
> local nKeyCount := 0
>
> TRY
> nKeyCount = oRs:RecordCount()
> CATCH
> nKeyCount = 0
> END
>
> return nKeyCount
>
> best regards
>
> Antonio
>
>
> 2009/7/21 Richard M. Lipkin <lipkinrm@dhec.sc.gov>:
>> Antonio
>>
>> I have been monitoring the error.log and it seems that line 3765 is still giving us trouble :
>>
>> Rick Lipkin
>>
>> DEFAULT ::bGoTop := {|| If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:MoveFirst(), nil ) },;
>> ::bGoBottom := {|| If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:MoveLast(), nil ) },;
>> ::bSkip := {| n | AdoSkip( ::oRs, If( n==nil, 1, n ) ) },;
>> ::bBof := {|| ::oRs:Bof },;
>> ::bEof := {|| ::oRs:Eof },;
>> ::bBookMark := {| n | If( n == nil,;
>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:BookMark, 0 ), ;
>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ( ::oRs:BookMark := n ), 0 ) ) }, ;
>> ::bKeyNo := {| n | If( n == nil, ;
>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:AbsolutePosition, 0 ), ;
>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ( ::oRs:AbsolutePosition := n ), 0 ) ) },;
>> ::bKeyCount := {|| If( ::oRs != nil, ::oRs:RecordCount(), 0 ) } // <--- line 3765 ... errors here
>>
>>
>> Application
>> ===========
>> Path and name: J:\VEHICLE\Veh32.Exe (32 bits)
>> Size: 969,216 bytes
>> Time from start: 0 hours 8 mins 52 secs
>> Error occurred at: 07/21/2009, 10:55:04
>> Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: RECORDCOUNT
>> Args:
>>
>> Stack Calls
>> ===========
>> Called from: source\rtl\win32ole.prg => TOLEAUTO:RECORDCOUNT(0)
>> Called from: xbrowse.prg => (b)TXBROWSE:SETADO(3765)
>> Called from: xbrowse.prg => TXBROWSE:PAINT(1254)
>> Called from: xbrowse.prg => TXBROWSE:DISPLAY(957)
>> Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(1423)
>> Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
>> Called from: => DIALOGBOXINDIRECT(0)
>> Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
>> Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG(343)
>> Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS(27)
>> Called from: source\rtl\win32ole.prg => TOLEAUTO:RECORDCOUNT(0)
>> Called from: xbrowse.prg => (b)TXBROWSE:SETADO(3765)
>> Called from: xbrowse.prg => TXBROWSE:PAINT(1254)
>> Called from: xbrowse.prg => TXBROWSE:DISPLAY(957)
>> Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(1423)
>> Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
>> Called from: => WINRUN(0)
>> Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(952)
>> Called from: MAIN.PRG => MAIN(381)
>>
>>>>> Antonio Linares 7/20/2009 6:39 PM >>>
>> Rick,
>>
>>>
>> Just curious .. why would this now be showing up and it never showed
>> up before, nor could I reproduce it on my machine .. and the
>> oBrw:End() .. I thought closing the winmdi would also close the
>> listbox ??
>>>
>>
>> Difficult to know it. There must be a reason, surely we will discover it
>>
>> The idea of End()ing the browse was to avoid further paintings. The
>> wmdichild ends it also, but if we end it before then no paint may
>> happen.
>>
>>> Do you think this could have something to do with xHarbor's VM ?? .. especially when several other applications are open ??
>>
>> I don't think so. I think it is related to ADO
>>
>> best regards,
>>
>> Antonio
>>>
>>> Thanks
>>> Rick LIpkin
>>>
>>>>>> Antonio Linares 7/20/2009 5:01 PM >>>
>>> Rick,
>>>
>>> Try this:
>>>
>>> ::bKeyCount := {|| If( ::oRs != nil, ::oRs:RecordCount(), 0 ) }
>>>
>>> best regards
>>>
>>> Antonio
>>>
>>>
>>>
>>> 2009/7/20 Richard M. Lipkin <lipkinrm@dhec.sc.gov>:
>>>> Antonio
>>>>
>>>> Here is the modified code as per your suggestion :
>>>>
>>>> /* origional code
>>>>
>>>>
>>>> DEFAULT ::bGoTop := {|| If( ::oRs:RecordCount() > 0, ::oRs:MoveFirst(), nil ) },;
>>>> ::bGoBottom := {|| If( ::oRs:RecordCount() > 0, ::oRs:MoveLast(), nil ) },;
>>>> ::bSkip := {| n | AdoSkip( ::oRs, If( n==nil, 1, n ) ) },;
>>>> ::bBof := {|| ::oRs:Bof },;
>>>> ::bEof := {|| ::oRs:Eof },;
>>>> ::bBookMark := {| n | If( n == nil,;
>>>> If( ::oRs:RecordCount() > 0, ::oRs:BookMark, 0 ), ;
>>>> If( ::oRs:RecordCount() > 0, ( ::oRs:BookMark := n ), 0 ) ) }, ;
>>>> ::bKeyNo := {| n | If( n == nil, ;
>>>> If( ::oRs:RecordCount() > 0, ::oRs:AbsolutePosition, 0 ), ;
>>>> If( ::oRs:RecordCount() > 0, ( ::oRs:AbsolutePosition := n ), 0 ) ) },;
>>>> ::bKeyCount := {|| ::oRs:RecordCount() }
>>>> */
>>>>
>>>> DEFAULT ::bGoTop := {|| If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:MoveFirst(), nil ) },;
>>>> ::bGoBottom := {|| If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:MoveLast(), nil ) },;
>>>> ::bSkip := {| n | AdoSkip( ::oRs, If( n==nil, 1, n ) ) },;
>>>> ::bBof := {|| ::oRs:Bof },;
>>>> ::bEof := {|| ::oRs:Eof },;
>>>> ::bBookMark := {| n | If( n == nil,;
>>>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:BookMark, 0 ), ;
>>>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ( ::oRs:BookMark := n ), 0 ) ) }, ;
>>>> ::bKeyNo := {| n | If( n == nil, ;
>>>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ::oRs:AbsolutePosition, 0 ), ;
>>>> If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ( ::oRs:AbsolutePosition := n ), 0 ) ) },;
>>>> ::bKeyCount := {|| ::oRs != nil .and. ::oRs:RecordCount() }
>>>>
>>>>
>>>> Notice this last line ::bKeyCount := {|| ::oRs != nil .and. ::oRs:RecordCount() } .. if you add >0 , nil to the if expression .. the listbox errors on line 411 .. however if you leave the parameters out .. all seems to work well.
>>>>
>>>> I will keep my fingers crossed and let you know in the next day or two if this works.
>>>>
>>>> Thanks
>>>> Rick Lipkin
>>>>
>>>> Application
>>>> ===========
>>>> Path and name: C:\FOX\VEHSQL\Veh32.Exe (32 bits)
>>>> Size: 3,496,448 bytes
>>>> Time from start: 0 hours 0 mins 6 secs
>>>> Error occurred at: 07/20/2009, 16:36:21
>>>> Error description: Error BASE/1092 Argument error: MIN
>>>> Args:
>>>> [ 1] = N 10000
>>>> [ 2] = U
>>>>
>>>> Stack Calls
>>>> ===========
>>>> Called from: => MIN(0)
>>>> Called from: xbrowse.prg => (b)TXBROWSE:TXBROWSE(411)
>>>> Called from: => TXBROWSE:VSETRANGE(0)
>>>> Called from: xbrowse.prg => (b)TXBROWSE:TXBROWSE(326)
>>>> Called from: => TXBROWSE:KEYCOUNT(0)
>>>> Called from: xbrowse.prg => TXBROWSE:ADJUST(852)
>>>> Called from: xbrowse.prg => TXBROWSE:INITIATE(758)
>>>> Called from: xbrowse.prg => TXBROWSE:CREATEFROMCODE(654)
>>>> Called from: VEHBROW.PRG => _VBROW(231)
>>>> Called from: VEHBROW.PRG => _VEHBROW(41)
>>>> Called from: MAIN.PRG => (b)BUILDMENU(434)
>>>> Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437)
>>>> Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1003)
>>>> Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND(241)
>>>> Called from: => TMDIFRAME:HANDLEEVENT(0)
>>>> Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
>>>> Called from: => WINRUN(0)
>>>> Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(952)
>>>> Called from: MAIN.PRG => MAIN(381)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>> Antonio Linares 7/20/2009 1:24 PM >>>
>>>> Rick,
>>>>
>>>> I would modify these lines in Class TXBrowse:
>>>>
>>>> DEFAULT ::bGoTop := {|| If( ::oRs:RecordCount() > 0,
>>>> ::oRs:MoveFirst(), nil ) },;
>>>> ::bGoBottom := {|| If( ::oRs:RecordCount() > 0,
>>>> ::oRs:MoveLast(), nil ) },;
>>>> ::bSkip := {| n | AdoSkip( ::oRs, If( n==nil, 1, n ) ) },;
>>>> ::bBof := {|| ::oRs:Bof },;
>>>> ::bEof := {|| ::oRs:Eof },;
>>>> ::bBookMark := {| n | If( n == nil,;
>>>> If( ::oRs:RecordCount() > 0,
>>>> ::oRs:BookMark, 0 ), ;
>>>> If( ::oRs:RecordCount() > 0, (
>>>> ::oRs:BookMark := n ), 0 ) ) }, ;
>>>> ::bKeyNo := {| n | If( n == nil, ;
>>>> If( ::oRs:RecordCount() > 0,
>>>> ::oRs:AbsolutePosition, 0 ), ;
>>>> If( ::oRs:RecordCount() > 0, (
>>>> ::oRs:AbsolutePosition := n ), 0 ) ) },;
>>>> ::bKeyCount := {|| ::oRs:RecordCount() }
>>>>
>>>> with If( ::oRs != nil .and. ::oRs:RecordCount() > 0, ...
>>>>
>>>> and see what happens
>>>>
>>>> best regards
>>>>
>>>> Antonio Linares
>>>> http://www.fivetechsoft.com
>>>>
>>>>
>>>> 2009/7/20 Richard M. Lipkin <lipkinrm@dhec.sc.gov>:
>>>>> Antonio
>>>>>
>>>>> I may have a clue to the ADO error with xbrowse .. it appears that the effected users are using a 'print screen' utility to capture a region of the screen and for some reason .. ( after a certain length of time doing this ) .. when the user closes the browse .. the attached error occurs.
>>>>>
>>>>> Could this be a lostfocus error ??
>>>>>
>>>>> Rick Lipkin
>>>>>