Page 1 of 4

dbskipper intermitent error

PostPosted: Mon Sep 28, 2009 4:27 pm
by hag
All:
Ocassionally I get a the error message indicated. It happens at a msgwait() function in the code.
Anything i need to fix.
METHOD seems to be looking for a oDbf. I do use a browse without a oDbf.. it calls an array.
Works fine for me but once in awhile my users get the error.
HArvey

Code: Select all  Expand view
 Path and name: N:\cashFlow\plat2005\cashver3.exe (32 bits)
   Size: ********* bytes
   Time from start: 0 hours 2 mins 1 secs
   Error occurred at: 09/28/09, 10:46:11
   Error description: Error DBCMD/2001  Workarea not in use: DBSKIPPER

Stack Calls
===========
   Called from:  => DBSKIPPER(0)
   Called from:  => TDATABASE:SKIPPER(0)
   Called from:  => (b)SETODBF(3427)
   Called from: .\xbrowse.PRG => (b)TXBROWSE(296)
   Called from:  => TXBROWSE:SKIP(0)
   Called from:  => TXBROWSE:PAINT(1030)
   Called from:  => TXBROWSE:DISPLAY(854)
   Called from:  => TXBROWSE:HANDLEEVENT(0)
   Called from: .\source\classes\WINDOW.PRG => _FWH(0)
   Called from:  => DIALOGBOXINDIRECT(0)
   Called from:  => TDIALOG:ACTIVATE(0)
   Called from: .\source\function\MSGRUN.PRG => MSGRUN(0)
   Called from: .\source\function\MSGRUN.PRG => MSGWAIT(0)
   Called from: .\NEWFRESH.PRG => COMBINE(2301)

Re: dbskipper intermitent error

PostPosted: Tue Sep 29, 2009 8:17 am
by PeterHarmes
I can confirm that my clients occaisonally get this error too - i don't use xBrowse in their system, so i will get the error log that they get and post it here later

Regards,

Pete

Re: dbskipper intermitent error

PostPosted: Tue Sep 29, 2009 9:03 am
by PeterHarmes
This is the error i am getting:

Application
===========
Path and name: Q:\WEIGMOD.EXE (32 bits)
Size: 3,497,984 bytes
Time from start: 0 hours 37 mins 17 secs
Error occurred at: 24/09/2009, 08:27:04
Error description: Error DBCMD/2001 Workarea not in use: DBSKIPPER
Args:

Stack Calls
===========
Called from: => DBSKIPPER(0)
Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:SKIP(1588)
Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:PAINT(716)
Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:DISPLAY(2040)
Called from: .\source\classes\CONTROL.PRG => TWBROWSE:HANDLEEVENT(1423)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)

Re: dbskipper intermitent error

PostPosted: Tue Sep 29, 2009 12:28 pm
by Rick Lipkin
Peter, Harvey

I have seen this error as well .. using Hernan's twbrowse .. best I can tell this error occurs when the last row has been deleted from the listbox and you use an UpStable() call ..

Take a look there to see if you can pin it down.

Rick Lipkin

Re: dbskipper intermitent error

PostPosted: Tue Sep 29, 2009 2:41 pm
by James Bott
Harvey, et. al.;

If you are setting the codeblocks yourself, please post that code here. If you are you should probably be using setRDD() instead (unless you need some special codeblock actions).

I suspect that you have a database function in one of your codeblocks that is not using an alias. This is another good reason to use database objects--you never have alias problems.

Also, it is helpful when you post a question to include the version of FWH that you are using.

James

Re: dbskipper intermitent error

PostPosted: Mon Oct 12, 2009 2:07 pm
by Richard Chidiak
I have this error on some of my clients pcs randomly, i think it has to be adressed.

here it a copy of the error.log

Error description: Error DBCMD/2001 Workarea not in use: DBSKIPPER

Stack Calls
===========
Called from: => DBSKIPPER(0)
Called from: C:\PRODUCTION\CBATIPROD\xbrowse.prg => (b)TXBROWSE:SETRDD(3312)
Called from: C:\PRODUCTION\CBATIPROD\xbrowse.prg => (b)TXBROWSE:TXBROWSE(308)
Called from: => TXBROWSE:SKIP(0)
Called from: C:\PRODUCTION\CBATIPROD\xbrowse.prg => TXBROWSE:PAINT(1280)
Called from: C:\PRODUCTION\CBATIPROD\xbrowse.prg => TXBROWSE:DISPLAY(927)
Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(0)
Called from: C:\PRODUCTION\CBATIPROD\window.prg => _FWH(3342)
Called from: => WINRUN(0)
Called from: C:\PRODUCTION\CBATIPROD\window.prg => TWINDOW:ACTIVATE(957)
Called from: C:\PRODUCTION\CBATIPROD\CBATIWIN.PRG => MAIN(241)

PS : I don't think it is an alias problem, this is handled by my app, and i have changed the setrdd method to handle this

here is my setrdd method

Code: Select all  Expand view

METHOD SetRDD( lAddColumns, lAutoOrder, aFldNames ) CLASS TXBrowse

   local oCol, aStruct
   local cAlias, cAdsKeyNo, cAdsKeyCount
   local nFields, nFor

   if ::cAlias == nil  // chidiak
      return nil
   endif

   if Empty( ::cAlias )
      ::cAlias := Alias()
      if Empty( ::cAlias )
         return nil
      endif
   endif

   if ::lCreated
      if ::nDataType == DATATYPE_RDD
         if SameDbfStruct( Self, Alias() )
            return nil
         endif
      endif
      ::cAlias := Alias()
      ::ClearBlocks()
      ::aCols  := {}
   endif

   DEFAULT lAddColumns      := Empty( ::aCols ) .or. ! Empty( aFldNames )
   DEFAULT lAutoOrder       := ::lAutoSort

   cAlias      := ::cAlias
   IF SELECT(cAlias) = 0  // Chidiak
      return nil
   ENDIF

   ::nDataType := DATATYPE_RDD


   DEFAULT ::bGoTop    := {|| ( ::cAlias )->( DbGoTop() ) },;
           ::bGoBottom := {|| ( ::cAlias )->( DbGoBottom() ) },;
           ::bSkip     := {| n | iif( n == nil, n := 1, ), ( ::cAlias )->( DbSkipper( n ) ) },;
           ::bBof      := {|| ( ::cAlias )->( Bof() ) },;
           ::bEof      := {|| ( ::cAlias )->( Eof() ) },;
           ::bBookMark := {| n | iif( n == nil,;
                                     ( ::cAlias )->( RecNo() ),;
                                     ( ::cAlias )->( DbGoto( n );
                                    ) ) }

   If "ADS"$( ::cAlias )->( RddName() ) .or. 'ADT' $ ( ::cAlias )->( RddName() )
      cAdsKeyNo    := "{| n, Self | iif( n == nil, " +;
                         "Round( " + cAlias + "->( ADSGetRelKeyPos() ) * Self:nLen, 0 ), "+;
                         cAlias + "->( ADSSetRelKeyPos( n / Self:nLen ) ) ) }"

      cAdsKeyCount := "{|| " + cAlias + "->( ADSKeyCount(,,1) )}"

      DEFAULT ::bKeyNo    := &cAdsKeyNo ,;
              ::bKeyCount := &cAdsKeyCount
   else
       DEFAULT ::bKeyNo    := {| n | iif( n == nil,;
                                        ( ::cAlias )->( OrdKeyNo() ),;
                                        ( ::cAlias )->( OrdKeyGoto( n );
                                        ) ) },;
               ::bKeyCount := {|| ( ::cAlias )->( OrdKeyCount() ) }
   Endif

   if lAddColumns
      aStruct      := ( ::cAlias )->( dbstruct() )

      if Empty( aFldNames )
         nFields      := ( ::cAlias )->( FCount() )
         nFields      := Len( aStruct )

         for nFor := 1 to nFields
            oCol    := ::AddCol()
            oCol    := SetColFromRDD( oCol, nFor, ::cAlias, aStruct, lAutoOrder )
         next nFor
      else
         nFields    := Len( aFldNames )
         for nFor := 1 to nFields
            oCol    := ::AddCol
            oCol    := SetColFromRDD( oCol, aFldNames[nFor], ::cAlias, aStruct, lAutoOrder )
         next nFor
      endif
   elseif lAutoOrder
      for nFor := 1 to Len( ::aCols )
         if ( ::cAlias )->( OrdNumber( ::aCols[ nFor ]:cHeader ) ) > 0
            ::aCols[nFor]:cSortOrder := ::aCols[ nFor ]:cHeader
         endif
      next nFor
   endif

   if lAutoOrder
      ::bSeek     := { |c| (::cAlias)->( DbSeek( c ) ) }
   endif

   ::bLock     := { || ( ::cAlias )->( DbrLock() ) }
   ::bUnlock   := { || ( ::cAlias )->( DbrUnlock() ) }

   if ::lCreated
      ::Adjust()
      ::Refresh()
   endif

return nil

 

Re: dbskipper intermitent error

PostPosted: Mon Oct 12, 2009 2:49 pm
by hag
Richard:

Do youR fix in the method is a permanent fix or are you still waiting for a fix?

Re: dbskipper intermitent error

PostPosted: Mon Oct 12, 2009 3:16 pm
by Richard Chidiak
Harvey

still waiting for a fix

Richard

Re: dbskipper intermitent error

PostPosted: Mon Oct 12, 2009 8:33 pm
by James Bott
Richard,

I am not sure why you need those cAlias traps. I don't see how you can create a browse without an alias since it is automatically created in the New() method. Do you know under what circumstances it is giving the alias error? Can you provide a small sample showing the error?

Regards,
James

Re: dbskipper intermitent error

PostPosted: Tue Oct 13, 2009 7:28 am
by Richard Chidiak
James

There is an alias in my browse definition

It looks like , somewhere, xbrowse is losing the alias

This is why i am using all these traps

The code is big, i can show it no problem , i am not sure it will help

Richard

Re: dbskipper intermitent error

PostPosted: Tue Oct 13, 2009 11:22 am
by James Bott
Richard,

>There is an alias in my browse definition
>It looks like , somewhere, xbrowse is losing the alias

I did a search of cAlias in TDatabase (dated 6/9/09) and I cannot find anywhere where cAlias is assigned nil or "". The only other possibility I can think of is that the database is never opened. Are you opening it via TDatabase or outside of TDatabase? Are you opening it in exclusive mode?

James

Re: dbskipper intermitent error

PostPosted: Tue Oct 13, 2009 11:57 am
by Richard Chidiak
James

The file is opened in shared mode ,

here is the code below

Thanks for your help,

Richard
Code: Select all  Expand view


IF APP1 = NIL
   LDEFAPP := .F.
   FOR DNUM = 1 TO 11
      AADD(TBTN,NIL)
   NEXT

   IF ! NETOPEN("SAVVISI",,5,"VISI")
      RETURN NIL
   ENDIF
   VISI->(ORDSETFOCUS("IDPVIS"))

   IF ! NETOPEN("SAVPVIS",,5,"PVIS")
      RETURN NIL
   ENDIF
   PVIS->(ORDSETFOCUS("CLI"))

   IF ! NETOPEN("SAVAPPEH",,5,"APPEH")  // HISTORIQUE
      RETURN NIL
   ENDIF
   APPEH->(ORDSETFOCUS("DATE"))

   IF ! NETOPEN("SAVAPPEL",,5,"APPEL")
      RETURN NIL
   ENDIF
   ASTRU := APPEL->(DBSTRUCT())
   APPEL->(ORDSETFOCUS("DATE"))
   APPEL->(DBGOTOP())

   DEFINE FONT aFONT NAME "Tahoma" SIZE 0,-14 BOLD

   DEFINE WINDOW APP1 TITLE " "  MDICHILD OF APPWND

   DEFINE BUTTONBAR oBar OF APP1 SIZE 50,50 3D

   DEFINE BUTTON TBTN[01] FILE DIRAPPLI() + "BMP\NOUVEAU.BMP" OF OBAR ;
          ACTION APPNEW(TABSEC,OBRWAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU)
   TBtn[01]:cToolTip = "Nouveau Message"

   DEFINE BUTTON TBTN[03] FILE DIRAPPLI() + "BMP\MODIFIER.BMP" OF OBAR ;
          ACTION APPMAJ(TABSEC,OBRWAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU)
   TBtn[03]:cToolTip = "Modifier Appel"

   DEFINE BUTTON TBTN[04] FILE DIRAPPLI() + "BMP\SUPPRIMER.BMP" OF OBAR ;
          ACTION SUPAPPEL(OBRWAPP)
   TBTN[04]:cToolTip = "Supprimer Appel"

   DEFINE BUTTON TBTN[05] FILE DIRAPPLI() + "BMP\LETTRED.BMP" OF OBAR ;
          ACTION TRAITAPPEL(OBRWAPP,DNUM,DNOM,ASTRU)
   TBTN[05]:cToolTip = "Traiter l'appel"

   DEFINE BUTTON TBTN[09] FILE DIRAPPLI() + "BMP\PRINT2.BMP" OF OBAR ;
          ACTION LISTAPPEL(,OBRWAPP,"APPEL")
   TBTN[09]:cToolTip = "Liste des Appels"

   DEFINE BUTTON TBTN[10] FILE DIRAPPLI() + "BMP\PLANNING.BMP" OF OBAR ;
          ACTION PLANNINGDEP(TABSEC,APPEL->CLI,APPEL->IDMOTIF,APPEL->CLINOM)
   TBTN[10]:cToolTip = "Planning"

   DEFINE BUTTON TBTN[11] FILE DIRAPPLI() + "BMP\MESSAGES.BMP" OF OBAR ;
          ToolTip "Messagerie" ;
          ACTION SAVMSG(DNUM,DNOM)
   TBTN[11]:cToolTip = "Messagerie"

   DEFINE BUTTON FILE DIRAPPLI() + "BMP\EVENEMENT.BMP" OF OBAR ;
          ToolTip "Gestion des Evénements";
          ACTION SAVEVENT()

   DEFINE BUTTON FILE DIRAPPLI() + "BMP\DEFAUT.BMP" OF OBAR ;
          ToolTip "Restituer tailles colonnes" ;
          ACTION (LDEFAPP := .T., RESETDEF(@obrwAPP,ADEF,@ASIZE,,"X"),ASIZE := {},oBrwAPP:GetDisplayColsWidth(@ASIZE ),ECRSIZE("S34",ASIZE)  )

   FOR I = 1 TO 8
       AADD(ASIZE,80)
   NEXT

   CREADEF(ASIZE,@ADEF)
   LIRESIZE("S34",@ASIZE)

   oBrwAPP := TXBrowse():New( APP1 )

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| TRNDATE(APPEL->DATE)}
   oCol:cHeader  := "Date" + CRLF + "Appel"
   oCol:bLClickHeader := {|| APPELPRO(1,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| APPEL->HEURE }
   oCol:cHeader  := "Heure" + CRLF + "Appel"
   oCol:bLClickHeader := {|| APPELPRO(2,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| APPEL->CLINOM }
   oCol:cHeader  := "Client"
   oCol:bLClickHeader := {|| APPELPRO(3,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| APPEL->PERS }
   oCol:cHeader  := "Appel" + CRLF + "Pris par"
   oCol:bLClickHeader := {|| APPELPRO(4,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| APPEL->MOTIF }
   oCol:cHeader  := "Motif"
   oCol:bLClickHeader := {|| APPELPRO(5,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| TRNDATE(APPEL->TRAITELE) }
   oCol:cHeader  := "Appel" + CRLF + "Traité le"
   oCol:bLClickHeader := {|| APPELPRO(6,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| APPEL->PERSPAR }
   oCol:cHeader  := "Traité" + CRLF + "Par"
   oCol:bLClickHeader := {|| APPELPRO(7,oBrwAPP,@NFOCUS,"APPEL") }

   oCol:=oBrwAPP:AddCol()
   oCol:bStrData := {|| APPELTCH("A") }
   oCol:bLClickHeader := {|| APPELPRO(8,oBrwAPP,@NFOCUS,"APPEL") }

   oBrwAPP:SetFont( aFont )
   oBrwAPP:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }
   oBrwAPP:bClrHEADER := {|| { CLR_BLUE, COULDLG("TD") } }

   oBrwAPP:bSeek := {|c| DbSeek( Upper( c ) ) }

   oBrwAPP:blDblClick := { | nRow, nCol, nKey | APPMAJ(TABSEC,oBrwAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU)   }
   oBrwAPP:bKeyDown   := {|nKey| iif(nKey=VK_RETURN, APPMAJ(TABSEC,oBrwAPP,AFONT,DNUM,DNOM,NFOCUS,ASTRU) ,IF(nKey = VK_DELETE,SUPAPPEL(oBrwAPP), ) )  }

   oBrwAPP:nMarqueeStyle := MARQSTYLE_HIGHLROW
   oBrwAPP:lColDividerComplete := .t.
   oBrwAPP:nColDividerStyle := LINESTYLE_LIGHTGRAY
   oBrwAPP:nRowDividerStyle := LINESTYLE_LIGHTGRAY

   oBrwAPP:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }
   oBrwAPP:bClrHEADER := {|| { CLR_BLUE, COULDLG("SD") } }

   oBrwAPP:cAlias    := "APPEL"

   oBrwAPP:nHeaderLines  := 2

   FOR I = 1 TO LEN(oBrwAPP:aCols)
       oBrwAPP:aCols[I]:nWidth  := ASIZE[I]
   NEXT

   oBrwAPP:CreateFromCode()
   APP1:oClient := oBrwAPP

   ACTIVATE WINDOW APP1 MAXIMIZED VALID( APP1 := NIL, .T. ) ;
                        ON INIT (oBrwAPP:SETFOCUS())

   AFONT:END()
 ELSE
   APP1:SETFOCUS()
ENDIF

 

Re: dbskipper intermitent error

PostPosted: Tue Oct 13, 2009 1:19 pm
by James Bott
Richard,

Your code is too complex to make a guess about the problem. But, any one of those functions called by the buttons could be closing the database under some circumstances.

Another possibility is that there is a non-alias reference call in TXbrowse and it only becomes a problem when the workarea is changed. One of your functions could be changing the workarea and not restoring it.

James

Re: dbskipper intermitent error

PostPosted: Tue Oct 13, 2009 2:42 pm
by hag
Richard:

Where in your code does it bomb out. Mine seems to be at a msgWait()

Re: dbskipper intermitent error

PostPosted: Tue Oct 13, 2009 2:51 pm
by James Bott
Harvey,

I just did a search of all the FWH source code and the only place msgWait() occurs is in the definition of the msgWait() function.

So, if you are getting an error at msgwait() it must be in your code.

James