Error DBCMD/2001 Workarea not in use: ORDKEYNO

Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby Dave Zowasky » Wed Sep 24, 2014 6:11 pm

Hello,

I have been seeing a problem error below.
It appears to happen when I click on a listbox.
It does not happen all the time. It happens from time to time
with no logical cause that I can produce with consistency
We use arrays to populate our listbox.
Below is a the code I use with my listbox for the array.

Any help or suggestion with this would be most appreciated.

Thanks
Dave

Code: Select all  Expand view

olba:bgotop    = { || x := 1 }                                                                                                                                                                                                                                
olba:bgobottom = { || x := eval( olba:blogiclen ) }                                                                                                                                                                                                            
olba:bskip     = { | nwant, nold | nold := x, x += nwant,;                                                                                                                                                                                                    
 x := max( 1, min( x, eval( olba:blogiclen ) ) ),;                                                                                                                                                                                                            
 x - nold }                                                                                                                                                                                                                                                    
olba:blogiclen = { || len( xlba ) }                                                                                                                                                                                                                            
olba:calias    = "array"                          

Application
===========
Path and name: C:\c1\c100u000\c100u000.exe (64 bits)
Size: 7,094,784 bytes
Compiler version: Harbour 3.2.0dev (Rev. 18881)
FiveWin Version: FWH 13.07
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 16 secs
Error occurred at: 09/24/14, 13:50:30
Error description: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Stack Calls
===========
Called from: => ORDKEYNO( 0 )
Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:MOUSEMOVE( 0 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 0 )
Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 0 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 0 )
Called from: c100u000.prg => MAIN( 96 )

System
======
Hardware memory: 3970 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Windows total applications running: 7
1 , C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17031_none_6242
2 , C:\WINDOWS\system32\SHLWAPI.dll
3 DDE Server Window, C:\WINDOWS\system32\ole32.dll
4 Explorer Browser Control, C:\WINDOWS\system32\SHELL32.dll
5 GDI+ Window,
6 Task Switching, C:\c1\c100u000\c100u000.exe
7 View X12 File, C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9600.16384_none_34a

Variables in use
================
Procedure Type Value
==========================
ORDKEYNO
Param 1: O Class: ERROR
TWBROWSE:MOUSEMOVE
Local 1: U
Local 2: U
TWINDOW:HANDLEEVENT
Param 1: N 152
Param 2: N 224
Param 3: N 1
Local 1: N 0
Local 2: N 1
Local 3: N 0
Local 4: N 9
Local 5: N 8
Local 6: N 62
Local 7: N 1
TCONTROL:HANDLEEVENT
Param 1: N 512
Param 2: N 1
Param 3: N 9961696
TWBROWSE:HANDLEEVENT
Param 1: N 512
Param 2: N 1
Param 3: N 9961696
Local 1: U
_FWH
Param 1: N 512
Param 2: N 1
Param 3: N 9961696
WINRUN
Param 1: N 9961696
Param 2: N 512
Param 3: N 1
Param 4: N 9961696
Param 5: N 24
Local 1: O Class: TWBROWSE
TWINDOW:ACTIVATE
Param 1: N 787920
MAIN
Param 1: C "NORMAL"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: U
Param 18: U
Param 19: U
Local 1: O Class: TWINDOW
Local 2: U
Local 3: U

Linked RDDs
===========
SQLBASE
SQLMIX
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX

DataBases in use
================

Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TFONT
5 TWINDOW
6 TBRUSH
7 TCONTROL
8 TFOLDEREX
9 TDIALOG
10 TBUTTON
11 TMSGBAR
12 TRECT
13 TMETER
14 TSAY
15 TMENU
16 TMENUITEM
17 TMRU
18 TINI
19 TICON
20 TIMAGELIST
21 TBITMAP
22 TTOOLBAR
23 TWBROWSE
24 TSCROLLBAR

Memory Analysis
===============
344 Static variables

Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
Dave Zowasky
Com1 Software, Inc.
http://www.com1software.com
information@com1software.com
330 653-3771
User avatar
Dave Zowasky
 
Posts: 125
Joined: Wed Oct 19, 2005 2:28 pm
Location: Hudson Ohio

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby karinha » Wed Sep 24, 2014 7:17 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby karinha » Wed Sep 24, 2014 7:18 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby Dave Zowasky » Thu Sep 25, 2014 6:06 pm

Thank you for the links on the subject.
Now that I have updated the syntax of my listbox
I would like to get the scrolling characteristics
to be like they were. In my older listbox I am able
roll the scroll bar on the mouse and the have the
selected item in the listbox scroll up and down in
my listbox. Is it possible to do this and if so is there a
good example of how to do it?
Dave Zowasky
Com1 Software, Inc.
http://www.com1software.com
information@com1software.com
330 653-3771
User avatar
Dave Zowasky
 
Posts: 125
Joined: Wed Oct 19, 2005 2:28 pm
Location: Hudson Ohio

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby karinha » Thu Sep 25, 2014 8:13 pm

Sorry.

Do not understand your question.

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby Dave Zowasky » Thu Sep 25, 2014 8:48 pm

In our existing application here is an example of our code for the listbox
Code: Select all  Expand view

 @ 3,8 listbox olba;
  fields prgdispmru(xa,a);
  size 100,100;
  header "MRU-Files";
  of oFldb:aDialogs[ 1 ];
  on dblclick(xfile:=xa[a],winexec("c:\windows\notepad "+xfile))
  a:=1
  olba:bgotop    = { || a := 1 }
  olba:bgobottom = { || a := eval( olba:blogiclen ) }
  olba:bskip     = { | nwant, nold | nold := a, a += nwant,;
  a := max( 1, min( a, eval( olba:blogiclen ) ) ),;
  a - nold }
  olba:blogiclen = { || len( xa ) }
  olba:calias    = "array"
 


I can rewrite the code this way and it will work
Code: Select all  Expand view

@  3, 8 LISTBOX olba VAR citem ITEMS xa;
         SIZE 100, 100;
         of oFldb:aDialogs[ 1 ];
         on dblclick(xfile:=xa[olba:getpos()],winexec("c:\windows\notepad "+xfile))
 


My problem is I am not sure what to do.

It seems that the listbox has gone thru a lot of changes and that my approach
to it's use may antiquated.

In a more complex application here is how we use it
Code: Select all  Expand view

 @ 12,1 listbox olba;
 fields ctl49700a(xa,a);
 size 480,100;
 header "Segment Data";
 of oFld:aDialogs[ 1 ]
 a:=1
 olba:bgotop    = { || a := 1 }
 olba:bgobottom = { || a := eval( olba:blogiclen ) }
 olba:bskip     = { | nwant, nold | nold := a, a += nwant,;
 a := max( 1, min( a, eval( olba:blogiclen ) ) ),;
 a - nold }
 olba:blogiclen = { || len( xa ) }
 olba:calias    = "array"
 olba:bchange:={|| xinv:=ctl49700f(xsega,a,xtype),;
                    xb:=ctl49700e(xa[a],xst,xds,xss),;
                    b:=1,;
                    olbb:refresh(),;
                    xln:=ctl49700h(a,maxseg),;
                    oxln:refresh(),;  
                    oxinv:refresh() }


**************************
 @ 12,62 listbox olbb;
 fields ctl49700a(xb,b);
 size 200,100;
 header "Element Data";
 of oFld:aDialogs[ 1 ]
 b:=1
 olbb:bgotop    = { || b := 1 }
 olbb:bgobottom = { || b := eval( olbb:blogiclen ) }
 olbb:bskip     = { | nwant, nold | nold := b, b += nwant,;
 b := max( 1, min( b, eval( olbb:blogiclen ) ) ),;
 b - nold }
 olbb:blogiclen = { || len( xb ) }
 olbb:calias    = "array"

* olbb:bGotFocus := {|| IF(SELECT(olbb) = 0,;
*                   (olbb := NIL,oFld:aDialogs[ 1 ]:SetFocus(),;
*                   oFld:aDialogs[ 1 ]:PostMsg(WM_CLOSE),;
*                   oFld:aDialogs[ 1 ] := NIL ) , ) }


**************************
 @ 4,1 listbox olbc;
 fields ctl49700a(xc,c);
 size 400,100;
 header "Item";
 of oFld:aDialogs[ 1 ]
 c:=1
 olbc:bgotop    = { || c := 1 }
 olbc:bgobottom = { || c := eval( olbc:blogiclen ) }
 olbc:bskip     = { | nwant, nold | nold := c, c += nwant,;
 c := max( 1, min( c, eval( olbc:blogiclen ) ) ),;
 c - nold }
 olbc:blogiclen = { || len( xc ) }
 olbc:calias    = "array"

 olbc:bchange:={||a:=ctl49700q(xsega,c,xtype),;
                  olba:refresh(),;
                   xinv:=ctl49700f(xsega,a,xtype),;
                   xb:=ctl49700e(xa[a],xst,xds,xss),;
                   b:=1,;
                   olbb:refresh(),;
                   xln:=ctl49700h(a,maxseg),;
                   oxln:refresh(),;  
                   oxinv:refresh()  }
 


I guess the simple question is what can I add to my existing code to correct
the DBCMD/2001 Workarea not in use: ORDKEYNO error?

Thanks
Dave Zowasky
Com1 Software, Inc.
http://www.com1software.com
information@com1software.com
330 653-3771
User avatar
Dave Zowasky
 
Posts: 125
Joined: Wed Oct 19, 2005 2:28 pm
Location: Hudson Ohio

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby James Bott » Mon Oct 06, 2014 3:53 pm

Dave,

I am guessing that sometimes a workarea with an index is selected and other times there is none and thus the error.

The way to test this is to create a small test program and test it with and without a selected workarea.

Of course this should not be a problem since you are using an array, but if it is a problem then the best solution is to fix the listbox class.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby Euclides » Tue Oct 07, 2014 12:14 pm

Dave, this way it should work:
Code: Select all  Expand view
//  Program TESTLBX1.PRG
#include "fivewin.ch"

Function Main()
local oDlg, oLba, prgdispmru:={{"TESTLBX1.PRG"}}, xfile

   DEFINE DIALOG oDlg

   @ 1,1 listbox olba fields prgdispmru[oLba:nAt, 1];
         size 100,50  header "MRU-Files"  of oDlg ;
         on dblclick(xfile:=prgdispmru[oLba:nAt, 1], winexec("c:\windows\notepad "+xfile))
   oLba:SetArray( prgdispmru)
   ACTIVATE DIALOG oDlg
return nil 

As you can see in fivewin.ch:
@ <nRow>, <nCol> LISTBOX VAR : is translated to TListBox():New( <nRow>, <nCol> and works with single arrays

@ <nRow>, <nCol> LISTBOX FIELDS : is translated to TWBrowse():New( <nRow>, <nCol>, ...) and works with arrays inside arrays.
HTH & regards
Euclides
User avatar
Euclides
 
Posts: 156
Joined: Wed Mar 28, 2007 1:19 pm

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby James Bott » Thu Oct 09, 2014 3:51 pm

Any progress on this?

I think you could force the error by switching to a new workarea before calling the listbox. This would confirm the cause of the problem.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Error DBCMD/2001 Workarea not in use: ORDKEYNO

Postby Dave Zowasky » Mon Oct 13, 2014 7:50 pm

Euclides and James,

I appreciate your help.

I have modified my code in a fashion that Euclides has posted.
So far so good.
Code: Select all  Expand view

function testlb2()
local odlg
local xa:=array(2)
local a:=1
local olba
xa[1]:="atest"
xa[2]:="btest"
 DEFINE DIALOG oDlg
@ 0,0 listbox olba;
fields prgdispmru(xa,oLba:nAt);
  size 100,50;
  of odlg;
  on dblclick(msginfo(str(oLba:nAt)))
 oLba:SetArray(xa)
ACTIVATE DIALOG oDlg
return(nil)
 

I should know soon how well it is working.

Thanks Much
Dave
Dave Zowasky
Com1 Software, Inc.
http://www.com1software.com
information@com1software.com
330 653-3771
User avatar
Dave Zowasky
 
Posts: 125
Joined: Wed Oct 19, 2005 2:28 pm
Location: Hudson Ohio


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests