error with Harbour and Windows 7

error with Harbour and Windows 7

Postby ukservice » Mon Jan 09, 2012 9: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: Select all  Expand view
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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: error with Harbour and Windows 7

Postby Rick Lipkin » Mon Jan 09, 2012 9: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: Select all  Expand view


// 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: error with Harbour and Windows 7

Postby ukservice » Tue Jan 10, 2012 8:10 am

Thank you very much.

Also, Harbour now provides HB_DIRBASE().
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests