Again I continue to have probles with xBrowse and closure on valid .. here is the error code :
- Code: Select all Expand view RUN
Application
===========
Path and name: J:\VEHICLE\VEH32.EXE (32 bits)
Size: 3,496,448 bytes
Time from start: 4 hours 23 mins 9 secs
Error occurred at: 08/06/2009, 14:00:54
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: => 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)
Here is Line 957
Here is line 1254
Here is line 3765
Here is the valid close for the browse :
- Code: Select all Expand view RUN
IF oRsVEH:eof
oRsVEH:MoveFirst()
ENDIF
cTITLE := "SELECT * from VEHICLES where AGENCY = '"+xAGENCY+"'"
nWd := GetSysMetrics(0) * .79
nHt := GetSysMetrics(1) * .8
lOK := .F.
DEFINE ICON oICO RESOURCE "KEY"
DEFINE WINDOW oWnd1 ;
FROM 10,10 to nHt, nWd PIXEL ;
TITLE cTITLE ;
MENU BuildMenu( oRsVeh ) ;
ICON oICO ;
NOMINIMIZE ;
NOZOOM ;
MDICHILD
@ 0, 0 xBROWSE oBrw of oWnd1 ;
RECORDSET oRsVeh ;
COLUMNS 'VNUMBER', ;
'TYPE', ;
'LICENSE', ;
'AGENCY', ;
'MEMO', ;
'MAKE', ;
'TYPE', ;
'YEAR', ;
'PROG', ;
'MOTORPOOL', ;
'REGION', ;
'LASTSERVCE', ;
'NEXTSERVCE', ;
'NEXTMILAGE', ;
'SERIALNUMB', ;
'ACTIVE', ;
'READONLY' ;
COLSIZES 48,50,80,50,70,120,120,55,95,95,140,80,80,80,190,80,80 ;
HEADERS "Vnum", ;
"Type", ;
"License", ;
"Agency", ;
"See Memo", ;
"Make", ;
"Model", ;
"Year", ;
"Program", ;
"Mtrpool", ;
"Location", ;
"LastServ", ;
"NextServ", ;
"NextMilage", ;
"Serial#", ;
"Act", ;
"ReadOnly" ;
AUTOSORT AUTOCOLS LINES CELL
oBrw:bClrStd := {|| {CLR_BLACK, if( oRsVeh:Fields("readonly"):Value = 'Y', RGB(179,203,204), CLR_WHITE ) } }
oBrw:CreateFromCode()
oWnd1:oClient := oBrw
oBrw:aCols[2]:bEditValue := { |x|DispType( oRsVeh) }
oBrw:aCols[5]:bEditValue := { |y|DispMemo( oRsVeh) }
oBrw:bLDblClick := { |nRow,nCol | _VehView( "V", oRsVeh ) }
oBrw:bKeyDown := { |nKey| _Manual( nKey,oRsVeh ) }
ACTIVATE WINDOW oWND1 ;
ON INIT( oBrw:SetFocus(), .F. ) ;
VALID ( IIF( !lOK, ( oBrw:lCreated := .f., _VehClose(.T.) ), .F. ))
* VALID ( IIF( !lOK, ( oBrw:End(), _VehClose(.T.) ), .F. ))
* VALID ( IIF( !lOK, _VehClose(.T.), .F. ))
RETURN( .T. )
//------------------------
static FUNCTION _VehClose( lCLEAN ) //, oRsVEH )
IF lCLEAN = .T.
lOK := .T.
* VEHNUM := oRsVEH:Fields("LICENSE"):Value
* FERASE( "C:\DBOVL\VEHNUM.MEM" )
* SAVE All like VEHNUM to C:\DBOVL\VEHNUM.MEM
* oBRW:cALIAS:=NIL
oBrw:End()
oRsVEH:CLose()
oRsVeh := NIL
* _CleanUP()
ENDIF
RETURN(.T.)
//----------------------------------
// fix for recordcount error
Static function GetKeyCount( oRs )
local nKeyCount := 0
if empty( oRs )
msginfo( "oRs is nil" )
RETURN( 0 )
ENDIF
TRY
nKeyCount := oRs:RecordCount()
CATCH
nKeyCount := 0
END
return( nKeyCount )
As you can see .. there is nothing special here and I have taken everyones advice on closing the browse .. there somewhere from line 957 in the xbrowse code .. the chain of events are still fireing that lead to this intermittant failure.
Any Hints ??
Rick Lipkin