FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour add a field to a dbf
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
add a field to a dbf
Posted: Thu Jul 31, 2008 09: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: add a field to a dbf
Posted: Thu Jul 31, 2008 09: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

Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
add a field to a dbf
Posted: Fri Aug 01, 2008 08: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
add a field to a dbf
Posted: Fri Aug 01, 2008 09:07 AM

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

EMG

Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
add a field to a dbf
Posted: Fri Aug 01, 2008 09: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
add a field to a dbf
Posted: Fri Aug 01, 2008 09:57 AM

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

EMG

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Add Fields to DBF
Posted: 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.

Continue the discussion