error DBCMD/2001 Work area not in use : ORDLISTADD 
Author Message
 error DBCMD/2001 Work area not in use : ORDLISTADD

HI..
I have a problem on the network.
I installed my program on the novell network server.
When open it as single form the client computer, it has no problem. but the
error comes out when I open it at second computer.
Error is
" error DBCMD/2001 Work area not in use : ORDLISTADD "

My source is
select 1
use cent index cent1,cent2,cent3,cent4,cent5

What did I do wrong?
Please reply..



Tue, 09 Apr 2002 03:00:00 GMT  
 error DBCMD/2001 Work area not in use : ORDLISTADD

Quote:

> I have a problem on the network.
> I installed my program on the novell network server.
> When open it as single form the client computer, it has no problem. but the
> error comes out when I open it at second computer.
> Error is
> " error DBCMD/2001 Work area not in use : ORDLISTADD "

> My source is
> select 1
> use cent index cent1,cent2,cent3,cent4,cent5

Probably your environment isn't sharable :)
If first user open cent, he have exclusive rights to this table, and other
can't.
Try:
#include "set.ch"
set( _SET_EXCLUSIVE, "OFF" )

or
set exclusive off

BTW - in network environment you should use this code to open databases:

LOCAL nTimeOut := 15
[...]
SET EXCLUSIVE OFF // of course :)
 BEGIN SEQUENCE
    do while .t.
        use cent index cent1, cent2, cent3, cent4, cent5
        if !neterror() // <- success, user can open table
            exit
        endif
        inkey(1) // time delay, but millisec( 1000 ) from CA Tools III is
better
        nTimeOut --
        if nTimeOut == 0
                // ask user if he wish wait more
            if ( user wish wait )
                nTimeOut    := 15
            else
                // user can't open table, what should we do?
                // maybe quit or call another procedure or break - see
            endif
        endif
    enddo

    // here is the rest of your program
    [....]

RECOVER USING .... // if you want break
END SEQUENCE

I think you should write procedure/function to open any table, if you wish i
can send you a little of my code.
Regards



Wed, 10 Apr 2002 03:00:00 GMT  
 error DBCMD/2001 Work area not in use : ORDLISTADD

Quote:

>> I have a problem on the network.
>> I installed my program on the novell network server.
>> When open it as single form the client computer, it has no problem. but
the
>> error comes out when I open it at second computer.
>> Error is
>> " error DBCMD/2001 Work area not in use : ORDLISTADD "

>> My source is
>> select 1
>> use cent index cent1,cent2,cent3,cent4,cent5

>Probably your environment isn't sharable :)
>If first user open cent, he have exclusive rights to this table, and other
>can't.
>Try:
>#include "set.ch"
>set( _SET_EXCLUSIVE, "OFF" )

>or
>set exclusive off

>BTW - in network environment you should use this code to open databases:

>LOCAL nTimeOut := 15
>[...]
>SET EXCLUSIVE OFF // of course :)
> BEGIN SEQUENCE
>    do while .t.
>        use cent index cent1, cent2, cent3, cent4, cent5
>        if !neterror() // <- success, user can open table
>            exit
>        endif
>        inkey(1) // time delay, but millisec( 1000 ) from CA Tools III is
>better
>        nTimeOut --
>        if nTimeOut == 0
>                // ask user if he wish wait more
>            if ( user wish wait )
>                nTimeOut    := 15
>            else
>                // user can't open table, what should we do?
>                // maybe quit or call another procedure or break - see
>            endif
>        endif
>    enddo

>    // here is the rest of your program
>    [....]

>RECOVER USING .... // if you want break
>END SEQUENCE

>I think you should write procedure/function to open any table, if you wish
i
>can send you a little of my code.
>Regards

Hi Maciej Jablonski
Thank you for your reply..
I have no experience of network program with clipper.
If you can, please send me your code or procedure.
Do I have to use your code when open each database everytime?


Wed, 10 Apr 2002 03:00:00 GMT  
 error DBCMD/2001 Work area not in use : ORDLISTADD

Quote:
>When open it as single form the client computer, it has no problem. but the
>error comes out when I open it at second computer.
>Error is " error DBCMD/2001 Work area not in use : ORDLISTADD "

This error mean that the file (DBF) or files (NTXS)  was not succesfuly
opened

Quote:

>My source is
>select 1
>use cent index cent1,cent2,cent3,cent4,cent5

One problem of opening the database "by hand" everytime is needed (as you do
above) is that when your application need a new index (by example cent6),
then you will need to add this file in all your code where the database is
opened.

As Maciej Jablonski wrote, is better to write a UDF in order to maintain all
index files opened properly.
I am using this function working very nice in all my apps. (about 9 years of
code).

*** PUT THIS IN A CONSTANTS DEFINITION FILE (.CH)
// constants
#define TRUE .t.
#define FALSE .f.
#define EXT ".CDX"

// OpenFile flags
#define RW_SH 1 // read-write, shared
#define RO_SH 2 // read-only, shared
#define RW_EX 3 // read-write, no-shared
#define RO_EX 4 // read-only, no-shared

*** PUT THIS IN YOR APP.
public ini_data := "C:\MyDir"

func OpenDBF( cBase, nMode, lIndex)
 local RetVal := TRUE, errorBlock
 default lIndex = TRUE
 cBase := upper(alltrim(cBase))
 errorBlock := errorblock( {|objError|ErrorHandler(objError)} )
 begin sequence
  dbusearea(TRUE,,alltrim(ini_data)+"\"+cBase,,nModo<=2,nModo%2=0 )
  if lIndex
   OrdListAdd( alltrim(ini_data)+"\"+cBase+EXT )
  endif
  RetVal := TRUE
 recover using objError
  Alert("Error intentando abrir base de datos;Archivo:
+upper( objError:filename ), {" Aceptar "})
  if select( cBase )!=0
   (cBase)->( dbclosearea() )
  endif
  RetVal:=FALSE
 end sequence
 errorblock(errorBlock)
return RetVal

If you want, i will send you some code in order to help you.

Bye, from Caracas, Venezuela.



Thu, 11 Apr 2002 03:00:00 GMT  
 error DBCMD/2001 Work area not in use : ORDLISTADD
Thank you.
I have solved the problem.
I'll keep your code.
Thanks again.

Quote:
>>When open it as single form the client computer, it has no problem. but
the
>>error comes out when I open it at second computer.
>>Error is " error DBCMD/2001 Work area not in use : ORDLISTADD "

>This error mean that the file (DBF) or files (NTXS)  was not succesfuly
>opened

>>My source is
>>select 1
>>use cent index cent1,cent2,cent3,cent4,cent5

>One problem of opening the database "by hand" everytime is needed (as you
do
>above) is that when your application need a new index (by example cent6),
>then you will need to add this file in all your code where the database is
>opened.

>As Maciej Jablonski wrote, is better to write a UDF in order to maintain
all
>index files opened properly.
>I am using this function working very nice in all my apps. (about 9 years
of
>code).

>*** PUT THIS IN A CONSTANTS DEFINITION FILE (.CH)
>// constants
>#define TRUE .t.
>#define FALSE .f.
>#define EXT ".CDX"

>// OpenFile flags
>#define RW_SH 1 // read-write, shared
>#define RO_SH 2 // read-only, shared
>#define RW_EX 3 // read-write, no-shared
>#define RO_EX 4 // read-only, no-shared

>*** PUT THIS IN YOR APP.
>public ini_data := "C:\MyDir"

>func OpenDBF( cBase, nMode, lIndex)
> local RetVal := TRUE, errorBlock
> default lIndex = TRUE
> cBase := upper(alltrim(cBase))
> errorBlock := errorblock( {|objError|ErrorHandler(objError)} )
> begin sequence
>  dbusearea(TRUE,,alltrim(ini_data)+"\"+cBase,,nModo<=2,nModo%2=0 )
>  if lIndex
>   OrdListAdd( alltrim(ini_data)+"\"+cBase+EXT )
>  endif
>  RetVal := TRUE
> recover using objError
>  Alert("Error intentando abrir base de datos;Archivo:
>+upper( objError:filename ), {" Aceptar "})
>  if select( cBase )!=0
>   (cBase)->( dbclosearea() )
>  endif
>  RetVal:=FALSE
> end sequence
> errorblock(errorBlock)
>return RetVal

>If you want, i will send you some code in order to help you.

>Bye, from Caracas, Venezuela.



Mon, 15 Apr 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. error DBCMD/2001 Workarea not in use

2. Help Error DBCMD/2001 workarea not in use: __dbpack

3. Workarea not in use DBCMD/2001

4. DBCMD/2001 Workarea not in use: DBSEEK

5. Clipper Runtime: DBCMD 2001 error message

6. ERROR - DBCMD/2001

7. DBCMD/2001 "Work Area not in use" - what does it mean?

8. DBCMD 2001

9. Error message Ordlistadd (0) Internal error 1010

10. APL-L Digest - 24 Sep 2001 to 25 Sep 2001 (#2001-223)

11. APL-L Digest - 14 Jun 2001 to 15 Jun 2001 (#2001-136)

12. APL-L Digest - 22 Mar 2001 to 23 Mar 2001 (#2001-63)

 

 
Powered by phpBB® Forum Software