FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour error with Harbour and Windows 7
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
error with Harbour and Windows 7
Posted: Mon Jan 09, 2012 09:04 PM
Hi,


When using an application in a folder different that Program Files,
such as Desktop, sometimes I get this error:


Error description: Error DBCMD/2001 WORKAREA NOT IN USE: ORDLISTADD


Stack Calls
===========
Called from: => ORDLISTADD( 0 )
Called from: ../../../rddord.prg => DBSETINDEX( 0 )
Called from: H:\spa\files.PRG => Openfiles( 108 )


Code (fw): Select all Collapse
openfiles.prg: 
==================== 
 LOCAL pPath := ".\"
 [...]

           SELECT 7 
lin 108 USE (pPath+"\NOTES") NEW



What is wrong?. Thanks.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: error with Harbour and Windows 7
Posted: Mon Jan 09, 2012 09:24 PM
Hope this helps .. I always query the location where the .exe starts up and then use that as my Set Defa ... path ..

Consider this code ..

Code (fw): Select all Collapse
// where .exe started from is default directory //
cFILE    := GetModuleFileName( GetInstance() )
cSTART := RAT( "\", cFILE )
cDEFA   := SUBSTR(cFILE,1,cSTART-1)

SET DEFA to ( cDEFA )

// if data is located in the same folder as the executable

Select 7
Use ( cDefa+"\Data\User.dbf" )

// or if data is located backwards

Select 7

Use ( cDefa+"..\data\User.dbf" )


The above code works whether you access the .exe via unc or a mapped drive.

Rick Lipkin
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: error with Harbour and Windows 7
Posted: Tue Jan 10, 2012 08:10 AM

Thank you very much.

Also, Harbour now provides HB_DIRBASE().

FWH 11.11, Harbour 3.1 and Borland C++ 5.82

Continue the discussion