xBrowse ERROR
xBrowse ERROR
Hi
I have any time this error on my application
How to resolve it ???
Error DBCMD/2001 Workarea non in use: __DBSKIPPER
Stack-List
==========
Called from: => __DBSKIPPER(0)
Called from: fiveh\xbrowse.prg => (b)TXBROWSE_SETRDD(3936)
Called from: fiveh\xbrowse.prg => (b)TXBROWSE(436)
Called from: fiveh\xbrowse.prg => TXBROWSE:SKIP(0)
Called from: fiveh\xbrowse.prg => TXBROWSE:CALCROWSELPOS(1298)
Called from: fiveh\xbrowse.prg => TXBROWSE:REFRESH(1274)
Called from: XBRWDBF.PRG => (b)XBRW_DB(169)
Thanks to all
I have any time this error on my application
How to resolve it ???
Error DBCMD/2001 Workarea non in use: __DBSKIPPER
Stack-List
==========
Called from: => __DBSKIPPER(0)
Called from: fiveh\xbrowse.prg => (b)TXBROWSE_SETRDD(3936)
Called from: fiveh\xbrowse.prg => (b)TXBROWSE(436)
Called from: fiveh\xbrowse.prg => TXBROWSE:SKIP(0)
Called from: fiveh\xbrowse.prg => TXBROWSE:CALCROWSELPOS(1298)
Called from: fiveh\xbrowse.prg => TXBROWSE:REFRESH(1274)
Called from: XBRWDBF.PRG => (b)XBRW_DB(169)
Thanks to all
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
Are you setting the xbrowse alias of the database?
James
James
Re: xBrowse ERROR
Yes
sometimes goes to error when I close the window
not always
sometimes goes to error when I close the window
not always
Re: xBrowse ERROR
Like James suggested :
DBSELECTAREA("CUST")
@ 35, 15 XBROWSE oBrw OF oXbrDlg1 ;
SIZE 400, 176 PIXEL ;
ALIAS "CUST" CELL LINES
...
...
Best regards
Uwe
DBSELECTAREA("CUST")
@ 35, 15 XBROWSE oBrw OF oXbrDlg1 ;
SIZE 400, 176 PIXEL ;
ALIAS "CUST" CELL LINES
...
...
Best regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
Can we see your code for the browse?
James
James
Re: xBrowse ERROR
the problem is when i close the window
anytime go to error
regards
********************************************************************************************************************* // xBROWSE
Function XBRW_DB(nDBF,aDB,nFUN,nDES,nSRC,nSTA,nFIL,nBUT,oUSR,nSCH,nICO,bSALDO,nTAG,bCOLOR,bPOP,oFONT,bGO,nUFLT,bUKEY)
Local oWIN,oICO,oXDBF,oBAR,oPOPEXP
Local oBRW,nUSR:=0
Local oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP
Local nUNO:=StrTran(IIF(AT("/",nDES)>0,Left(nDES,Len(nDES)-2),nDES) ,CHR(34),"")
Local nDUE:=StrTran(IIF(AT("/",nDES)>0,Left(nUNO,Len(nUNO)-1)+Right(nDES,1),nDES),CHR(34),"")
Local nTIT:=nDUE
Local nFILE:=Upper(StrTran(Alltrim(nTIT)," ","_"))
Local nARG:={}
Local nBT1:=IIF(nBUT<>NIL,IIF(AT("1",nBUT)>0,.T.,.F.),.T.) // Ins
Local nBT2:=IIF(nBUT<>NIL,IIF(AT("2",nBUT)>0,.T.,.F.),.T.) // Mod
Local nBT3:=IIF(nBUT<>NIL,IIF(AT("3",nBUT)>0,.T.,.F.),.T.) // Can
Local nBT4:=IIF(nBUT<>NIL,IIF(AT("4",nBUT)>0,.T.,.F.),.T.) // Vis
Local nBT5:=IIF(nBUT<>NIL,IIF(AT("5",nBUT)>0,.T.,.F.),.T.) // Ante
Local nBT6:=IIF(nBUT<>NIL,IIF(AT("6",nBUT)>0,.T.,.F.),.T.) // Stampa
Local nBT7:=IIF(nBUT<>NIL,IIF(AT("7",nBUT)>0,.T.,.F.),.T.) // Ricerca
Local nBT8:=IIF(nBUT<>NIL,IIF(AT("8",nBUT)>0,.T.,.F.),.T.) // Filtro
Local nBT9:=IIF(nBUT<>NIL,IIF(AT("9",nBUT)>0,.T.,.F.),.T.) // Export
Local oBUT1,oBUT2,oBUT3,oBUT4,oBUT5,oBUT6,oBUT7,oBUT8,oBUT9
Local oSALDO,nSALDO:="",nAREA
Local nUSRFLT:=IIF(nUFLT<>NIL,.T.,.F.)
oXDBF:=APRI_DB(nDBF)
(oXDBF)->(DBSetIndex(nDBF))
IF Len(aDB) > 0
IF !Empty( aDB[1][5] )
(oXDBF)->(DBSetOrder( aDB[1][5] ))
Endif
Endif
IF nFIL<>NIL
IF !Empty(AllTrim(nFIL))
(oXDBF)->( CMFILTER( nFIL ) )
Endif
Endif
(oXDBF)->(DBGoTop())
IF bGO<>NIL
(oXDBF)->(DBGoBottom())
Endif
nAREA:=ALIAS()
IF !Empty(nICO)
DEFINE ICON oICO RESOURCE (nICO+"_ICO")
Else
DEFINE ICON oICO RESOURCE (nFUN+"_ICO")
Endif
DEFINE WINDOW oWIN MDICHILD TITLE nTIT ICON oICO FROM 0,0 TO 0,0 PIXEL
oBRW:=XBRW_CREA(oWIN,aDB,oXDBF,,oFONT,,,,,,nTAG,,bCOLOR)
nARG:={oWIN,oXDBF,oBRW,oICO,nFUN,nUNO,nDUE,nSRC,aDB,nSCH,nICO,nDBF,bSALDO,oSALDO,nTAG,bCOLOR,nUSRFLT,bUKEY}
DEFINE BUTTONBAR oBAR OF oWIN SIZE 70,60 TOP
oBAR:l2007:=.T.
...
oBRW:bKeyDown :={|Key| XBRW_KEY(Key,nARG,oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP,bUKEY)}
oBRW:bRClicked :={|R,C| XBRW_POP(R,C,nARG,oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP,bPOP)}
oWIN:oClient:=oBRW
oWIN:SetControl(oBRW)
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd) ;
VALID ( oBrw:bKeyCount:={||0} , oBrw:bKeyNo := {||0} , CLOSE_DB(oXDBF) , .T. )
Return .T.
************************ // Close DataBase
Function CLOSE_DB(oDBF)
IF oDBF<>NIL
(oDBF)->(DBCloseArea())
Return .T.
Endif
Return .F.
anytime go to error
regards
********************************************************************************************************************* // xBROWSE
Function XBRW_DB(nDBF,aDB,nFUN,nDES,nSRC,nSTA,nFIL,nBUT,oUSR,nSCH,nICO,bSALDO,nTAG,bCOLOR,bPOP,oFONT,bGO,nUFLT,bUKEY)
Local oWIN,oICO,oXDBF,oBAR,oPOPEXP
Local oBRW,nUSR:=0
Local oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP
Local nUNO:=StrTran(IIF(AT("/",nDES)>0,Left(nDES,Len(nDES)-2),nDES) ,CHR(34),"")
Local nDUE:=StrTran(IIF(AT("/",nDES)>0,Left(nUNO,Len(nUNO)-1)+Right(nDES,1),nDES),CHR(34),"")
Local nTIT:=nDUE
Local nFILE:=Upper(StrTran(Alltrim(nTIT)," ","_"))
Local nARG:={}
Local nBT1:=IIF(nBUT<>NIL,IIF(AT("1",nBUT)>0,.T.,.F.),.T.) // Ins
Local nBT2:=IIF(nBUT<>NIL,IIF(AT("2",nBUT)>0,.T.,.F.),.T.) // Mod
Local nBT3:=IIF(nBUT<>NIL,IIF(AT("3",nBUT)>0,.T.,.F.),.T.) // Can
Local nBT4:=IIF(nBUT<>NIL,IIF(AT("4",nBUT)>0,.T.,.F.),.T.) // Vis
Local nBT5:=IIF(nBUT<>NIL,IIF(AT("5",nBUT)>0,.T.,.F.),.T.) // Ante
Local nBT6:=IIF(nBUT<>NIL,IIF(AT("6",nBUT)>0,.T.,.F.),.T.) // Stampa
Local nBT7:=IIF(nBUT<>NIL,IIF(AT("7",nBUT)>0,.T.,.F.),.T.) // Ricerca
Local nBT8:=IIF(nBUT<>NIL,IIF(AT("8",nBUT)>0,.T.,.F.),.T.) // Filtro
Local nBT9:=IIF(nBUT<>NIL,IIF(AT("9",nBUT)>0,.T.,.F.),.T.) // Export
Local oBUT1,oBUT2,oBUT3,oBUT4,oBUT5,oBUT6,oBUT7,oBUT8,oBUT9
Local oSALDO,nSALDO:="",nAREA
Local nUSRFLT:=IIF(nUFLT<>NIL,.T.,.F.)
oXDBF:=APRI_DB(nDBF)
(oXDBF)->(DBSetIndex(nDBF))
IF Len(aDB) > 0
IF !Empty( aDB[1][5] )
(oXDBF)->(DBSetOrder( aDB[1][5] ))
Endif
Endif
IF nFIL<>NIL
IF !Empty(AllTrim(nFIL))
(oXDBF)->( CMFILTER( nFIL ) )
Endif
Endif
(oXDBF)->(DBGoTop())
IF bGO<>NIL
(oXDBF)->(DBGoBottom())
Endif
nAREA:=ALIAS()
IF !Empty(nICO)
DEFINE ICON oICO RESOURCE (nICO+"_ICO")
Else
DEFINE ICON oICO RESOURCE (nFUN+"_ICO")
Endif
DEFINE WINDOW oWIN MDICHILD TITLE nTIT ICON oICO FROM 0,0 TO 0,0 PIXEL
oBRW:=XBRW_CREA(oWIN,aDB,oXDBF,,oFONT,,,,,,nTAG,,bCOLOR)
nARG:={oWIN,oXDBF,oBRW,oICO,nFUN,nUNO,nDUE,nSRC,aDB,nSCH,nICO,nDBF,bSALDO,oSALDO,nTAG,bCOLOR,nUSRFLT,bUKEY}
DEFINE BUTTONBAR oBAR OF oWIN SIZE 70,60 TOP
oBAR:l2007:=.T.
...
oBRW:bKeyDown :={|Key| XBRW_KEY(Key,nARG,oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP,bUKEY)}
oBRW:bRClicked :={|R,C| XBRW_POP(R,C,nARG,oINS,oMOD,oCAN,oVIS,oANT,oSTA,oSRC,oFLT,oEXP,bPOP)}
oWIN:oClient:=oBRW
oWIN:SetControl(oBRW)
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd) ;
VALID ( oBrw:bKeyCount:={||0} , oBrw:bKeyNo := {||0} , CLOSE_DB(oXDBF) , .T. )
Return .T.
************************ // Close DataBase
Function CLOSE_DB(oDBF)
IF oDBF<>NIL
(oDBF)->(DBCloseArea())
Return .T.
Endif
Return .F.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
Code: Select all
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd) ;
VALID ( oBrw:bKeyCount:={||0} , oBrw:bKeyNo := {||0} , CLOSE_DB(oXDBF) , .T. )
Try:
Code: Select all
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd)
oXDBF:close()
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
Also, I don't understand this syntax:
(oDBF)->(DBCloseArea())
oDBF would have to be an alias except the prefix indicates that it is a database object. This is the generic syntax:
(cAlias)->(DBCloseArea())
However if oDBF is a database object (as the prefix indicates), then you close it this way:
(oDBF:cAlias)->(DBCloseArea())
But the database class already does this in it's Close method so you can just do this:
oDBF:close()
Actually, to be consistent with standard naming (polymorphism) it technically should be:
oDBF:end()
But our TDatabase class doesn't have an End() method so we have to use the Close() method. The advantage of polymorphism is that you can end any object using the same syntax.
James
(oDBF)->(DBCloseArea())
oDBF would have to be an alias except the prefix indicates that it is a database object. This is the generic syntax:
(cAlias)->(DBCloseArea())
However if oDBF is a database object (as the prefix indicates), then you close it this way:
(oDBF:cAlias)->(DBCloseArea())
But the database class already does this in it's Close method so you can just do this:
oDBF:close()
Actually, to be consistent with standard naming (polymorphism) it technically should be:
oDBF:end()
But our TDatabase class doesn't have an End() method so we have to use the Close() method. The advantage of polymorphism is that you can end any object using the same syntax.
James
Re: xBrowse ERROR
I don't use the class TDatabase
oDBF is the alias of database
oDBF is the alias of database
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
OK, still you should change it to:oDBF is the alias of database
Code: Select all
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd)
CLOSE_DB(oXDBF)
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
Oh, and Hungarian notation says that the alias variable should be cAlias not oDBF. The "o" prefix is to signify an object. Then people like me would be able to read your code more easily.oDBF is the alias of database
And if you were using a database object, the name would be very clear as:
oDBF:cAlias
And it would be even more clear with something like:
oCustomer:cAlias
However, if you are using database objects you very rarely have to use aliases. And there are lots of other reasons for using database objects. You should consider them. For more information see my website here: http://gointellitech.com/program.htm
Regards,
James
Re: xBrowse ERROR
I go to try it
Thank you very much James
Thank you very much James
Re: xBrowse ERROR
Try pulling the focus to oBrw
Excuse my English
Code: Select all
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd) ;
VALID ( oBar:aControls[1]:SetFocus() , CLOSE_DB(oXDBF) , .T. )
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: xBrowse ERROR
Cmsoft,
James
The problem would still exist. The browse must be closed before the database is closed. Closing the database after the window is closed means that the browse is closed also. Closing the database in the VALID clause of the window means the database is closed before the browse, thus the browse errors out.Try pulling the focus to oBrw
James
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xBrowse ERROR
We should close the DBF "after" the window is closed. Once the window is closed, the browse object also is destroyed.
So, we should not close the DBF in the valid clause, because the window and browse objects are still active.
When we are using MDICHILD windows, the best place to close DBF is inside the oWin:bPostEnd codeblock. This codeblock is evaluated after the window is closed (and all controls are destroyed)
Please close the DBF in the oWin:bPostEnd codeblock.
This is the safe and recommended way.
In the case of your example above, please replace the code:
with
Notes:
1) oWin:SetControl( oBrw ) includes a call to "oWin:oClient := oBrw".
2) ON INIT WndAdjClient(oWIN:hWnd) is not necessary.
I may also suggest that the caption is inappropriate. This is not Xbrowse error.
So, we should not close the DBF in the valid clause, because the window and browse objects are still active.
When we are using MDICHILD windows, the best place to close DBF is inside the oWin:bPostEnd codeblock. This codeblock is evaluated after the window is closed (and all controls are destroyed)
Please close the DBF in the oWin:bPostEnd codeblock.
Code: Select all
oWin:bPostEnd := { || ( cAlias )->( DBCLOSEAREA() ) }
In the case of your example above, please replace the code:
Code: Select all
oWIN:oClient:=oBRW
oWIN:SetControl(oBRW)
ACTIVATE WINDOW oWIN ON INIT WndAdjClient(oWIN:hWnd) ;
VALID ( oBrw:bKeyCount:={||0} , oBrw:bKeyNo := {||0} , CLOSE_DB(oXDBF) , .T. )
Code: Select all
oWIN:SetControl(oBRW)
oWin:bPostEnd := { || CLOSE_DB( oXDBF ) }
ACTIVATE WINDOW oWIN
1) oWin:SetControl( oBrw ) includes a call to "oWin:oClient := oBrw".
2) ON INIT WndAdjClient(oWIN:hWnd) is not necessary.
I may also suggest that the caption is inappropriate. This is not Xbrowse error.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India