DBF TEMPORARY

Re: DBF TEMPORARY

Postby bpd2000 » Fri Jul 17, 2015 12:24 pm

thefull wrote:Hi Enrico
I use NTX, and Harbour 3.2 i don't problem.
New code.

Code: Select all  Expand view

  REQUEST DBFNTX
  REQUEST HB_MEMIO

  function Main()
          rddsetdefault( 'DBFNTX' )   // RDD NTX
         test_memio()
  return nil

    /* Create file dbf and ntx/ in memory */
    function test_memio()
        dbcreate( "mem:test.dbf", { { "F1", "N", 10, 0 }, { "F2", "N", 10, 0 } } )
       use "mem:test.dbf" alias memtest
       index on field->f2 to "mem:tmp1.ntx" DESCENDING

       for i := 1 to 100000
         append blank
         memtest->f1 := i
         memtest->f2 := i * 100
       next
       go top

       browse()
       dbDrop( "mem:test.dbf" )  /* Free memory resource */
       dbDrop( "mem:tmp1.ntx" )  /* Free memory resource */

    return nil
 

I can not compile your code
as
BUILDH memio.prg
Regards, Greetings

Try FWH. You will enjoy it's simplicity and power.!
User avatar
bpd2000
 
Posts: 153
Joined: Tue Aug 05, 2014 9:48 am
Location: India

Re: DBF TEMPORARY

Postby thefull » Fri Jul 17, 2015 1:41 pm

Please, add a your make file , the library hbmemio.lib
In /contrib/hbmemio you have code/example
Saludos
Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
User avatar
thefull
 
Posts: 731
Joined: Fri Oct 07, 2005 7:42 am
Location: Barcelona

Re: DBF TEMPORARY

Postby dbmanfwh » Wed Feb 17, 2016 6:13 am

Hi Antonio,

Tdatabase Error In MemoryDb.

xHarbour 1.2.3 (Build 20150419)
Fwh 15.04

Application
===========
Error description: Error BASE/1109 Argument error: $
Args:
[ 1] = C :\
[ 2] = U

Stack Calls
===========
Called from: .\source\classes\DATABASE.PRG => TDATABASE:SETAREA( 289 )
Called from: .\source\classes\DATABASE.PRG => TDATABASE:NEW( 221 )

Variables in use
================
Procedure Type Value
==========================
TDATABASE:SETAREA
Param 1: N 2
Local 1: O Class: TDATABASE
Local 2: U
Local 3: U
Local 4: A Len: 0
Local 5: A Len: 0
Local 6: U
Local 7: C ":\"
Local 8: U
Local 9: U
Local 10: U

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

1: => TEMP RddName: ARRAYRDD
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.


Code: Select all  Expand view

FUNCTION MAIN()

   LOCAL oDb
   LOCAL cAlias := cGetNewAlias("temp")
   LOCAL aStruct := { { "F1", "N", 10, 0 }, { "F2", "N", 10, 0 } }

   dbCreate( cAlias+".dbf",  aStruct, "ARRAYRDD" )

   USE (cAlias+".dbf") ALIAS (cAlias) NEW VIA "ARRAYRDD"
   (cAlias)->(DbSelectArea())

   DATABASE oDb    //  =======> error
   oDb:Zap()

RETURN oDb

 
Regards,
Moon
FWH 16.11 | xHarbour | Harbour | BCC72 | DBF | ADS | MySQL | DrLib
dbmanfwh
 
Posts: 38
Joined: Tue Mar 04, 2008 3:44 pm
Location: Korea

Re: DBF TEMPORARY

Postby Antonio Linares » Wed Feb 17, 2016 10:25 am

Try this:

DATABASE oDb FILE ""
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: DBF TEMPORARY

Postby nageswaragunupudi » Wed Feb 17, 2016 2:01 pm

The case of memory file was not considered when making this part of the code in database.prg.
Please enclose all lines from 289 to 295 inside an if condition "if ! Empty( ::cfile ) ........... endif"
like this
Code: Select all  Expand view
     
      if ! Empty( ::cFile )  // <-- now inserted
      if !( ":\" $ ::cFile ) //SubStr( ::cFile, 2, 2 ) != ":\"
         if Left( ::cFile, 1 ) == ''
            ::cFile  := CurDrive() + ':' + ::cFile
         else
            ::cFile  := CurDrive() + "
:\" + CurDir() + "\" + ::cFile
         endif
      endif
      endif // <-- now inserted

We shall adopt a suitable fix in the next release
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: DBF TEMPORARY

Postby dbmanfwh » Wed Feb 17, 2016 2:25 pm

I tried so.

But, error appears.

USE (cAlias+".dbf") ALIAS (cAlias) NEW VIA "ARRAYRDD"
? Select() // 1
? (CAlias )->( DbInfo (DBI _ FULLPATH)) // nul

1.
DEFINE DATABASE oDb FILE ""
? oDb:nAarea // ======> Result 0
oDb:zap() // Error database.prg (177) ===> METHOD Zap() INLINE ( ::nArea )->( DbZap() )

Error description: Error DBCMD/2001 Workarea not in use: __DBZAP

Called from: => __DBZAP( 0 )
Called from: .\source\classes\DATABASE.PRG => (b)TDATABASE:TDATABASE( 177 )
Called from: => TDATABASE:ZAP( 0 )

2.
DATABASE oDb

Error description: Error BASE/1109 Argument error: $
Called from: .\SOURCE\TDatabase.prg => TDATABASE:SETAREA( 289 )
Called from: .\SOURCE\TDatabase.prg => TDATABASE:NEW( 221 )

Because it returns nul from Memodb that (CAlias )->( DbInfo (DBI _ FULLPATH))
database.prg (288)
::cFile = ( nWorkArea )->( DbInfo( DBI_FULLPATH ) ) // ======> Result nul
database.prg (289) line Error
if !( ":\" $ ::cFile ) //SubStr( ::cFile, 2, 2 ) != ":\"
Regards,
Moon
FWH 16.11 | xHarbour | Harbour | BCC72 | DBF | ADS | MySQL | DrLib
dbmanfwh
 
Posts: 38
Joined: Tue Mar 04, 2008 3:44 pm
Location: Korea

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 24 guests