add a field to a dbf

Post Reply
MOISES
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

add a field to a dbf

Post by MOISES »

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
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: add a field to a dbf

Post by Enrico Maria Giordano »

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
MOISES
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Post by MOISES »

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
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Post by Enrico Maria Giordano »

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

EMG
MOISES
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Post by MOISES »

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

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Post by Enrico Maria Giordano »

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

EMG
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Add Fields to DBF

Post by ukoenig »

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.
Post Reply