Page 1 of 1

Creating your first dbf file

Posted: Wed Dec 14, 2016 6:03 am
by bluebird
After learning quite a lot of the programming basics and writing some none data programs, I need now to create my own xbase DBF file.

Does HMG have of know a create utility that a reader could recommend?

Thanks all

Re: Creating your first dbf file

Posted: Wed Dec 14, 2016 6:18 am
by CalScot
Have you tried (from within IDE) selecting the menu items "Project" then "New Table"?
It's been a while since I used it, but I do remember that it worked.
Personally, I still prefer using dBaseIII to create .dbf files, but maybe you don't have a copy?
Good luck!

Re: Creating your first dbf file

Posted: Wed Dec 14, 2016 6:22 am
by mol
Do you mean whole database system, with a lot of tables, indexes realtions or creating one .dbf file?
If first, you need to study a lot of creating relation databases.
If second, you can use dbu.exe with a lot of variations of this tool.
You can create dbf file by DBCreate function:
(hmg\samples\advanced\memory_tables\demo.prg)

Code: Select all

Function CreateTable
*--------------------------------------------------------*

   DBCREATE("mem:test", {{"CODE", "C", 3, 0},{"NAME", "C", 50, 0},{"RESIDENTS", "N", 11, 0}},, .T., "memarea")

   DBAPPEND()
   REPLACE CODE WITH 'LTU', NAME WITH 'Lithuania', RESIDENTS WITH 3369600
   DBAPPEND()
   REPLACE CODE WITH 'USA', NAME WITH 'United States of America', RESIDENTS WITH 305397000
   DBAPPEND()
   REPLACE CODE WITH 'POR', NAME WITH 'Portugal', RESIDENTS WITH 10617600
   DBAPPEND()
   REPLACE CODE WITH 'POL', NAME WITH 'Poland', RESIDENTS WITH 38115967
   DBAPPEND()
   REPLACE CODE WITH 'AUS', NAME WITH 'Australia', RESIDENTS WITH 21446187
   DBAPPEND()
   REPLACE CODE WITH 'FRA', NAME WITH 'France', RESIDENTS WITH 64473140
   DBAPPEND()
   REPLACE CODE WITH 'RUS', NAME WITH 'Russia', RESIDENTS WITH 141900000

Return Nil

Creating your first dbf file

Posted: Wed Dec 14, 2016 10:27 am
by Pablo César
  1. By IDE (as CalScot said). If you want to see a step-by-step, Esgici did a good job on his site:

    Https://vivaclipper.wordpress.com/2013/ ... b-manager/

    By the way, Rathi/Claudio. Is it possible to be included this contain (of course if Esgici permits to use his material) in our HMG doc ?
     
  2. Manually (as Marek said): inside your PRG.
     
  3. Using the old DBU / dBase or any other edit DBF utility.

    Here's under list:
    viewtopic.php?t=4082
    viewtopic.php?t=209
    viewtopic.php?t=4304
    http://www.pctoledo.com.br/forum/fileba ... t=c&page=1
    http://www.pctoledo.com.br/forum/fileba ... t=c&page=3

Re: Creating your first dbf file

Posted: Wed Dec 14, 2016 12:21 pm
by esgici
...if Esgici permits to use his material in our HMG doc ?
Everything in VivaClipper is public domain; no permission required for any kind of use.
 
[*]Using the old DBU / dBase or any other edit DBF utility.
Here's under list:
...
http://hmgforum.com/viewtopic.php?f=10&t=42

and last release.

Viva HMG :D

Re: Creating your first dbf file

Posted: Wed Dec 14, 2016 3:04 pm
by dragancesu
+1