TO ANTONIO HELP for ordscope ad ordetfocus

TO ANTONIO HELP for ordscope ad ordetfocus

Postby Silvio » Tue Feb 08, 2011 3:37 pm

I HAVE WINDOWS SEVEN HOME PREMIUM 64 BIT on new portable computer

I have this error

Code: Select all  Expand view

Application
===========
   Path and name: C:\work\PRG\agenda2\Agenda2.Exe (32 bits)
   Size: 2,383,360 bytes
   Time from start: 0 hours 0 mins 11 secs
   Error occurred at: 08-02-2011, 20:50:49
   Error description: Error DBCMD/2001  Workarea not in use: ORDSETFOCUS

Stack Calls
===========
   Called from:  => ORDSETFOCUS(0)
   Called from: source\gut120.prg => ADDDATES(344)
   Called from: source\gut120.prg => (b)BUILDCALEX(186)
   Called from: .\source\prg\tcalex.PRG => TCALEX:SETVIEW(1279)
   Called from: .\source\prg\tcalex.PRG => (b)TCALEX:TCALEX(153)
   Called from:  => TCALEX:SETMONTHVIEW(0)
   Called from: source\gut120.prg => BUILDCALEX(186)
   Called from: source\gut120.prg => (b)GUT120(97)
   Called from: .\source\classes\DIALOG.PRG => TFSDI:INITIATE(720)
   Called from: .\source\classes\DIALOG.PRG => TFSDI:HANDLEEVENT(928)
   Called from:  => CREATEDLGINDIRECT(0)
   Called from: .\source\classes\DIALOG.PRG => TFSDI:ACTIVATE(302)
   Called from: source\gut120.prg => GUT120(97)
   Called from: source\MainLib.prg => (b)PERFORM(451)
   Called from: source\MainLib.prg => PERFORM(452)
   Called from: source\main.prg => (b)TAPPLICATION:BUILDBTNBAR(518)
   Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK(579)
   Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP(754)
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489)
   Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT(1398)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3394)
   Called from:  => WINRUN(0)
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(978)
   Called from: source\main.prg => TAPPLICATION:ACTIVATE(426)
   Called from: source\main.prg => MAIN(63)


I explain you


I open first the dbf with

oDCal:=Apri_dbf("citas",.t.,.t.)
(oDCal)->(OrdSetFocus(1))
(oDCal)->(DbGoTop())
...
AddDates(........)




this function Apri_dbf

Code: Select all  Expand view


FUNCTION Apri_Dbf( cDbf, lNew, lIdx, aIdx, nIdxa )
   LOCAL cFile, cABas, lErr := .F.
   LOCAL cDriver := DBSetDriver()
   LOCAL  nD, cAlias

   DEFAULT lNew := .T.
   DEFAULT lIdx := .F.
   DEFAULT nIdxa := .T.
   DEFAULT aIdx := NIL

   cDbf := Upper( cDbf )
   IF Empty( aDbfs )
      aDbfs := { }
   ENDIF

   IF Select( cDbf ) > 0
      DBSelectArea( cDbf )
      IF lNew
         nD := AScan( aDbfs, { | aAt | aAt[ 1 ] == cDbf } )
         IF nD > 0
            aDbfs[ nD, 2 ] ++
         ENDIF
         cAlias := New_Alias( cDbf, nD )
         DBUseArea( .T., cDriver, cDbf, cAlias, .T., .F. )
         IF File( cDbf + ".cdx" ) .and. nIdxa
            ( cAlias ) ->( DBSetIndex( cDbf ) )
            ( cDbf ) ->( DBSetOrder( 1 ) )
         ENDIF
      ENDIF
   ELSE
      IF ! File( cDbf + ".dbf" )


       MSGINFO("NON EXISTE IL DATAFILE")  //Non esiste il database
         lErr := .T.

      ELSE
         nD := AScan( aDbfs, { | aAt | aAt[ 1 ] == cDbf } )
         IF nD = 0
            AAdd( aDbfs, { cDbf, 1 } )
            nD := AScan( aDbfs, { | aAt | aAt[ 1 ] == cDbf } )
         ELSE
            aDbfs[ nD, 2 ] ++
         ENDIF
         cAlias := New_Alias( cDbf, nD )
         DBUseArea( .T., cDriver, cDbf, cAlias, .T., .F. )
         IF File( cDbf + ".CDX" ) .and. nIdxa
            ( cAlias ) ->( DBSetIndex( cDbf ) )
            ( cAlias ) ->( DBSetOrder( 1 ) )
         ENDIF
      ENDIF
   ENDIF
   IF ! lErr .AND. lIdx
      cFile := Upper( cDbf )
      cABas := Apri_Dbf( "BASE" )
      ( cABas ) ->( DBSeek( cFile ) )
      IF Found()
         DO WHILE ( cABas ) ->TABELLA = cFile .AND. ! ( cABas ) ->( Eof() )
            AAdd( aIdx, ( cABas ) ->Commento )
            //AAdd(aIdx,(cABas)->Legend)
            ( cABas ) ->( DBSkip() )
         ENDDO
      ENDIF
      Chiudi_Dbf( "BASE", cABas )
      DBSelectArea( cDbf )
   ENDIF
   RETURN ( cAlias )

 






and this function make error


Code: Select all  Expand view



FUNCTION  AddDates( dStart, dEnd, nStart, nEnd,oDCal )

     local dDate

   // compat with xharbour
  DEFAULT dStart := CToD("  /  /  ")
 DEFAULT dEnd   := CToD("  /  /  ")


   //Clear scopes
         (oDCal)->( OrdSetFocus(1))
         (oDCal)->(OrdScope(TOPSCOPE,Nil))
         (oDCal)->(OrdScope(BOTTOMSCOPE,Nil))


   //Set New scopes
   (oDCal)->(DBGoTop())
   (oDCal)->(OrdScope(TOPSCOPE, DToS( dStart ) + Str( nStart * 100, 4 ) ) )
   (oDCal)->(OrdScope(BOTTOMSCOPE, DToS( dEnd ) + Str( nEnd * 100, 4 ) ) )
   (oDCal)->(DBGoTop())

   oApp():oCalex:Reset()

   DO WHILE ! ( oDCal )->( Eof() )
     oApp():oCalex:LoadDates( ( oDCal )->START,;
                              ( oDCal )->END, ;
                              ( oDCal )->DSTART, ;
                              ( oDCal )->DEND, ;
                              ( oDCal )->TEXT, ;
                              ( oDCal )->SUBJECT,;
                              ( oDCal )->IDX )
      ( oDCal )->( DBSkip() )
   ENDDO



RETURN nil






where is the error ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO ANTONIO HELP for ordscope ad ordetfocus

Postby ukoenig » Tue Feb 08, 2011 11:08 pm

Silvio,

how do You create Your Index-files for CDX ?
Do You use ORD-functions, to build a working Index ?

Some Samples :
Code: Select all  Expand view

ORDCONDSET( , , , , , , , , , , .T. )   // Index reverse
ORDCREATE( ,"CUSTOMER1","STR(Year) + Number + Archiv", ;
                     {|| STR(Year) + Number + Archiv } , .T. )

ORDCREATE( ,"CUSTOMER2","LOWER(Archiv) + DESCEND(STR(Year) + STR(Month) + Number)", ;
                     {|| LOWER(Archiv) + DESCEND(STR(Year) + STR(Month) + Number) } , .F. )
 


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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TO ANTONIO HELP for ordscope ad ordetfocus

Postby Silvio » Wed Feb 09, 2011 8:02 am

Uwe,
I open WDBU and create a cdx from dbf
or
I have a mine function to create index. it open each file into BASE.dbf and make the index.
I used it from many year with success, for all my application, Now on W7 I not understood why it run bad only for that dbf.

then I open the wdbu on xp and create cdx
then I copyed the file cdx on wseven anf run the application
and it not run


I MADE A CONTROL INTO WDBU AND PRINT THE DBF STATUS : it IS GOOD !!
Image
THEN THE FUNCTION ADDDATES () NOT RUN
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: TO ANTONIO HELP for ordscope ad ordetfocus

Postby Silvio » Fri Feb 11, 2011 4:04 pm

resolved

was the antivirus !!!!!!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests