add a field to a dbf

add a field to a dbf

Postby MOISES » Thu Jul 31, 2008 9:20 pm

Hi,

I have a dbf with records. I would like to add new fields, but I don´t know the function. Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: add a field to a dbf

Postby Enrico Maria Giordano » Thu Jul 31, 2008 9:53 pm

Use DbStruct() to retrieve the structure of the current DBF, modify the structure, use DbCreate() to create a new DBF based on the modified structure, copy the record from the original DBF, delete the original DBF and rename the new DBF.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby MOISES » Fri Aug 01, 2008 8:58 am

Yes, I do as you said, but it would be faster to do

addfield (cdbf, cfieldname, cfieldtipe, len, dec)
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Postby Enrico Maria Giordano » Fri Aug 01, 2008 9:07 am

There is no such function, as far as I know.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby MOISES » Fri Aug 01, 2008 9:45 am

Thank you. That´s why I asked for it.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Postby Enrico Maria Giordano » Fri Aug 01, 2008 9:57 am

You can write such function yourself using the steps I listed above.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Add Fields to DBF

Postby ukoenig » Fri Aug 01, 2008 10:07 am

Hello Enrico,

I have this functions in my DBTOOLS included.
I will extract this from there and put it in the topic.

Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests