FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para CA-Clipper ayuda!!! COMO AGREGAR UN CAMPO A UNA DBF
Posts: 46
Joined: Tue Oct 10, 2006 06:16 PM
ayuda!!! COMO AGREGAR UN CAMPO A UNA DBF
Posted: Tue Oct 24, 2006 06:59 PM

HOLA A TODOS, UN FAVOR ALGUIEN ME PUEDE AYUDAR PARA AGREGAR UN CAMPO A UNA DBF DESDE FIVEWIN.

COMO PROGRAMAR ESTE CASO, PARA AGREGAR CAMPOS, ESPERO Y ME PUEDAN AYUDAR

:lol::shock:

Posts: 840
Joined: Thu Oct 13, 2005 07:05 PM
ayuda!!! COMO AGREGAR UN CAMPO A UNA DBF
Posted: Tue Oct 24, 2006 08:26 PM

es lo mismo para Clipper, xHarbour y FW, tienes que crear un dbf temporal:

1) Abres la tabla a la cual le quieres agregar un campo

USE tabla

2) Obtienes la estructura de la tabla

aEstructura := DBSTRUCT()

3) Cerramos la tabla

DBCLOSEAREA()

4) Agregamos los campos a la estrctura obtenida

AADD(aEstructura, {"campo","c",30,0})
AADD(aEstructura,{"otrocamp,"n",10,2})
AADD(aEstructura,{"otromas","l",1,0})

5) Creamos una tabla temporal

DBCREATE("temp.dbf",aEstructura)

6) La abrimos

USE temp.dbf

7) Agregamos los campos de la tabla anterior

APPEND FROM tabla

Borramos la tabla vieja

FERASE("tabla.dbf")

9) Renombramos la tabla temporal:

FRENAME("temp.dbf","tabla.dbF")

Y lisot

8)

Saludos

R.F.
Posts: 139
Joined: Sun Apr 23, 2006 09:00 AM
Y ten en cuenta los campos MEMO.
Posted: Thu Oct 26, 2006 04:15 PM

Pues eso, que si tienes en tu tabla algún campo de tipo MEMO, cuando crees la nueva tabla temporal (y si utilizas COMIX), te creará un archivo TEMPORAL.FPT, que tendrás que renombrar al igual que el archivo temporal TEMPORAL.DBF.

Un saludo,
Fernando

Un saludo,

Fernando

Las Palmas de Gran Canaria
Posts: 94
Joined: Tue Mar 28, 2006 04:09 PM
modstruc
Posted: Tue Nov 14, 2006 05:47 PM

Hola, yo tengo una funcion que hace eso sin tantas ondas raras, mandame un mail rubio.luisfernando@gmail.com y te lo paso...

Luis Fernando Rubio
Tequila, Jalisco, Mexico.

Luis Fernando Rubio Rubio

Continue the discussion