How to build DBF > 2 GB

235 views
Skip to first unread message

Auge & Ohr

unread,
Jun 20, 2024, 11:00:44 AM (13 days ago) Jun 20
to Harbour Users
Hi,

i know that Harbour can use DBF > 2 GB under 64 Bit using DB_DBFLOCK_HB64
but how to create a DBF > 2 GB ?

Gerald Drouillard

unread,
Jun 20, 2024, 11:09:27 AM (13 days ago) Jun 20
to harbou...@googlegroups.com
Your file system has to support it. 64bit OS?
> --
> You received this message because you are subscribed to the Google Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: https://groups.google.com/group/harbour-users
> ---
> You received this message because you are subscribed to the Google Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/3305f89e-95ce-439c-a377-540de912c732n%40googlegroups.com.

Auge & Ohr

unread,
Jun 20, 2024, 12:13:25 PM (13 days ago) Jun 20
to Harbour Users
hi,

> Your file system has to support it. 64bit OS?
Yes. running 64 Bit OS Version 10.0.19045.4529

marcos...@gmail.com

unread,
Jun 20, 2024, 4:35:48 PM (13 days ago) Jun 20
to Harbour Users
DBF of more than 4 GB

REQUEST DBFCDX

procedure main()
local nX
local nN

   /*
   sizemax.dbf
   code  N   15
   name  C   15000
   */

   RddSetDefault( "DBFCDX" )

   use sizemax new alias sizemax exclusive

   AddRec(300000)

   View(1000)

   ? "Records"
   ? transform(lastrec(),"99,999,999")
   dbCloseArea()

   ? "Size in bytes of dbf"
   ? transform( filesize("sizemax.dbf"), "99,999,999,999" )

   inkey(0)

return


procedure AddRec(nLimit)

   for nX := 1 to nLimit
      dbappend()
      nN := hb_random(9999)
      sizemax->code   := nN
      sizemax->name   := "maria of los angeles"
      ? nX
   next

return

procedure View(nlimit)

   dbgotop()
   for nX := 1 to nLimit
      ? sizemax->code
      ? alltrim(sizemax->name)
      dbskip()
   next

return

size.jpg
DBF of more than 4 GB

Auge & Ohr

unread,
Jun 21, 2024, 1:18:26 AM (12 days ago) Jun 21
to Harbour Users
hi,
thx for Sample.
but i can not create DBF using  name  C 15000 !

how to create DBF to use DB_DBFLOCK_HB64

greetings Jimmy

marcos...@gmail.com

unread,
Jun 21, 2024, 8:07:41 AM (12 days ago) Jun 21
to Harbour Users
Hello

Please modify the table so that the field only has 1000 characters. Attach code and dbf files of 15000 and 1000 characters.

REQUEST DBFCDX

procedure main()
local nX
local nN
local aStruct := {}


   /*
   sizemax.dbf
   code  N   15
   name  C   1000
   */

   RddSetDefault( "DBFCDX" )

   aStruct := {{"code", " N",  15,   0 } , ;
                      {"name", "C",1000, 0 }  ;
                     }

   dbCreate( "sizemax", aStruct )


   use sizemax new alias sizemax exclusive

   AddRec(5000000)
size1.jpg
sizemax.rar

Auge & Ohr

unread,
Jun 21, 2024, 9:15:29 AM (12 days ago) Jun 21
to Harbour Users
hi

> Please modify the table so that the field only has 1000 characters. Attach code and dbf files of 15000 and 1000 characters.

i can not create a DBF where a Field Type C have more than 256 Sign

how do you create those DBF Sizemax_1000 .DBF or Sizemax_15000.DBF inside your Attachment Sizemax.RAR ?

greetings JImmy

Auge & Ohr

unread,
Jun 21, 2024, 10:21:56 AM (12 days ago) Jun 21
to Harbour Users
hi

i have try to create BIg DBF using HAROUR 64 BIT and was surprise about RDD DBFCDX

REQUEST DBFCDX
REQUEST HB_GT_WIN_DEFAULT

Procedure Main
   RddSetDefault( "DBFCDX" )
   CreateSetup( "bigdbf.DBF" )
   use bigdbf new alias sizemax exclusive
   ... same as above

STATIC PROCEDURE CreateSetup( cDBF )
LOCAL oError, cText
LOCAL bOldError := ERRORBLOCK( { | e | BREAK( e ) } )
LOCAL aStruct   := { { "CODE", "N", 15, 0 }, ;
                                    { "NAME", "C", 1000, 0 } }
 BEGIN SEQUENCE
      DBCREATE( cDBF, aStruct, "DBFCDX" )
   RECOVER USING oError
      ERRORBLOCK( bOldError )
  ? oError:osCode
   END SEQUENCE
   ERRORBLOCK( bOldError )
RETURN

it does create a DBF with Field NAME Type C and Length 1000 without any Problem
so the Limit of Type C is > 256 under Harbour 64 Bit ?!

do i only need
SET DBFLOCKSCHEME TO DB_DBFLOCK_HB64
to use DBF > 2 GB under Harbour ?

greetings Jimmy

marcos...@gmail.com

unread,
Jun 21, 2024, 10:47:40 AM (12 days ago) Jun 21
to Harbour Users
I'm running 32-bit harbour and it generates a dbf of over 4 GB without any problems.

 Modify the code so that it generates a table with a 200 character field and enters 20 million records, the generated file was over 4 GB.

It is assumed that 64-bit port should not have any problems.

My computer is 64 bit but the harbour I use is 32 bit, I'm in the process of switching to a 64 bit harbour

Harbour Users

unread,
Jun 21, 2024, 11:09:42 AM (12 days ago) Jun 21
to Harbour Users

Auge & Ohr

unread,
Jun 21, 2024, 12:28:12 PM (12 days ago) Jun 21
to Harbour Users
hi,

> 'm running 32-bit harbour and it generates a dbf of over 4 GB without any problems.
it is not only to use DBF > 2 GB , i need also locking when Share DBF in Network

so 64 Bit OS is need and i must use
SET DBFLOCKSCHEME TO DB_DBFLOCK_HB64
to use DBF > 2 GB in Share Environment

greetings JImmy
Reply all
Reply to author
Forward
0 new messages