CAMPO AUTOINCREMENT - DBF [RESUELTO]
-
russimicro
- Posts: 413
- Joined: Sun Jan 31, 2010 3:30 pm
- Location: Bucaramanga - Colombia
Re: CAMPO AUTOINCREMENT - DBF (SOLUCIONADO )
Enrico... ya quedo ok..
Error mio, al usar un id (+) , cuando la tabla origen ya tenia un ID (numerico).. AL HACER EL APPEND FROM
Gracias
Error mio, al usar un id (+) , cuando la tabla origen ya tenia un ID (numerico).. AL HACER EL APPEND FROM
Gracias
Last edited by russimicro on Thu Oct 23, 2025 1:36 pm, edited 1 time in total.
Re: CAMPO AUTOINCREMENT - DBF
Code: Select all | Expand
// C:\FWH\SAMPLES\RUSSI.PRG
#include "FiveWin.ch"
FUNCTION Main()
// CREARDBF()
MsgRun( "AGUARDE... ABRINDO OS BANCOS DE DADOS. ", ;
"Por Favor, Espere Abertura. Pode Demorar.", ;
{ || WinExec( CREARDBF() ), 3 } )
RETURN NIL
FUNCTION CREARDBF()
IF FILE( "RUSSIMIC.DBF" )
DELETEFILE( "RUSSIMIC.DBF" )
IF FILE( "RUSSIMIC.DBF" )
? "OOOPPPSSSS"
QUIT // OOOPPPSSSS
ENDIF
ENDIF
IF .NOT. FILE( "RUSSIMIC.DBF" )
DbCreate( "RUSSIMIC.DBF", { { "ID", "+", 04, 00 }, ;
{ "SERIE", "C", 05, 00 }, ;
{ "NOME", "C", 50, 00 }, ;
{ "ENDERECO", "C", 50, 00 }, ;
{ "BAIRRO", "C", 30, 00 }, ;
{ "CIDADE", "C", 30, 00 }, ;
{ "UF", "C", 02, 00 }, ;
{ "CEP", "C", 09, 00 }, ;
{ "CGC", "C", 14, 00 }, ;
{ "INSCREST", "C", 18, 00 }, ;
{ "FONE", "C", 30, 00 }, ;
{ "FONE2", "C", 30, 00 }, ;
{ "CELULAR", "C", 30, 00 }, ;
{ "EMAIL", "C", 50, 00 }, ;
{ "EMAIL2", "C", 50, 00 }, ;
{ "SITE", "C", 50, 00 } } )
DbCloseAll()
ELSE
? "FILE NOT FOUND"
QUIT
ENDIF
USE RUSSIMIC ALIAS RUSSSIMIC
APPEND BLANK
XBROWSE()
DbCloseAll()
RETURN NIL
// FIN / END - [email protected]
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Enrico Maria Giordano
- Posts: 9054
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: CAMPO AUTOINCREMENT - DBF (SOLUCIONADO )
Great!russimicro wrote: Wed Oct 22, 2025 3:30 pm Enrico... ya quedo ok..
Error mio, al usar un id (+) , cuando la tabla origen ya tenia un ID (numerico)
Gracias
-
russimicro
- Posts: 413
- Joined: Sun Jan 31, 2010 3:30 pm
- Location: Bucaramanga - Colombia
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
Buen dia....
Encontre que con xharbour.com o comercial... funciona bien, siempre y cuando NO se ejecute
el comando ZAP antes del APPEND BLANK o APPEND FROM....
Ante esto se require crear la tabla con la nueva estructura (CREATE TABLE) y NO hacer un MODI STRU (agregar el ID - AUTOINCREMENT ) + ZAP
Encontre que con xharbour.com o comercial... funciona bien, siempre y cuando NO se ejecute
el comando ZAP antes del APPEND BLANK o APPEND FROM....
Ante esto se require crear la tabla con la nueva estructura (CREATE TABLE) y NO hacer un MODI STRU (agregar el ID - AUTOINCREMENT ) + ZAP
- Enrico Maria Giordano
- Posts: 9054
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
I don't understand. Can you provide a reduced and self-contained sample showing the problem?
-
russimicro
- Posts: 413
- Joined: Sun Jan 31, 2010 3:30 pm
- Location: Bucaramanga - Colombia
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
Enrico... aclaro es sobre xharbour.com y por el cual ya no hay soporte---
Solamente lo reporto a manera de "aviso"
ZAP : si activo el zap ... el autoincremento empieza en cero (0)
// ZAP : si desactivo el zap ... el autoincremento empieza en uno (1)
Nota : Esto NO sucede con harbour ni con xharbour.org
Gracias...
Ya sabiendo la causa en xharbour.com, ya pude resolver no haciendo modi stru + zap + append from, sino create table + append from
Gracias
//*****************
Enrico... I clarify this is about xharbour.com and there is no longer support for it.
Just reporting it as a "heads up"
ZAP: If I enable Zap... the auto-increment starts at zero (0)
// ZAP: If I disable Zap... the auto-increment starts at one (1)
Note: This does NOT happen with harbor or xharbour.org
Thanks...
Now that I know the cause for xharbour.com, I was able to resolve it by not doing mosi stru + zap + append from, but rather create table + append from.
Thanks
Ejp :
Solamente lo reporto a manera de "aviso"
ZAP : si activo el zap ... el autoincremento empieza en cero (0)
// ZAP : si desactivo el zap ... el autoincremento empieza en uno (1)
Nota : Esto NO sucede con harbour ni con xharbour.org
Gracias...
Ya sabiendo la causa en xharbour.com, ya pude resolver no haciendo modi stru + zap + append from, sino create table + append from
Gracias
//*****************
Enrico... I clarify this is about xharbour.com and there is no longer support for it.
Just reporting it as a "heads up"
ZAP: If I enable Zap... the auto-increment starts at zero (0)
// ZAP: If I disable Zap... the auto-increment starts at one (1)
Note: This does NOT happen with harbor or xharbour.org
Thanks...
Now that I know the cause for xharbour.com, I was able to resolve it by not doing mosi stru + zap + append from, but rather create table + append from.
Thanks
Ejp :
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
DBCREATE( "PRUEBA.DBF", { { "TEST", "+", 4, 0 } } )
USE PRUEBA EXCLUSIVE
// ZAP // INICIA EN UNO (1)
ZAP // INICIA EN CERO (0)
APPEND BLANK
APPEND BLANK
CLOSE
XBROWSER( "PRUEBA.DBF" )
RETURN NIL
Last edited by russimicro on Fri Oct 24, 2025 11:48 am, edited 1 time in total.
- Enrico Maria Giordano
- Posts: 9054
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
Ok, understood, but I can't help you with xharbour.com, sorry. 
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
Prueba asi:
Regards, saludos.
Code: Select all | Expand
// C:\FWH\SAMPLES\RUSSI2.PRG
#include "Fivewin.ch"
FUNCTION Main()
DBCREATE( "PRUEBA.DBF", { { "TEST", "+", 4, 0 }, ;
{ "ADRESS", "C", 40, 0 } } )
USE PRUEBA EXCLUSIVE NEW ALIAS PRUEBA
DBZAP()
BROWSE() // VACIO?
DBAPPEND()
RLOCK()
REPLACE ADRESS WITH "RUSSIMICRO1"
COMMIT
UNLOCK
DBAPPEND()
RLOCK()
REPLACE ADRESS WITH "RUSSIMICRO2"
COMMIT
UNLOCK
GO TOP
XBROWSE()
CLOSE DATABASE
RETURN NIL
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
-
russimicro
- Posts: 413
- Joined: Sun Jan 31, 2010 3:30 pm
- Location: Bucaramanga - Colombia
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
CON DBZAP()
TEST ADRESS
0 RUSSIMICRO1
1 RUSSIMICRO2
SIN DBZAP()
TEST ADRESS
1 RUSSIMICRO1
2 RUSSIMICRO2
Karinha...
La solucion es la que expuse... como se hace :
DBCREATE( "PRUEBA.DBF", { { "TEST", "+", 4, 0 }, ;
{ "ADRESS", "C", 40, 0 } } )
no se requiere el zap... y queda ok
Nota: esto es solo para xharbour comercial
Gracias
TEST ADRESS
0 RUSSIMICRO1
1 RUSSIMICRO2
SIN DBZAP()
TEST ADRESS
1 RUSSIMICRO1
2 RUSSIMICRO2
Karinha...
La solucion es la que expuse... como se hace :
DBCREATE( "PRUEBA.DBF", { { "TEST", "+", 4, 0 }, ;
{ "ADRESS", "C", 40, 0 } } )
no se requiere el zap... y queda ok
Nota: esto es solo para xharbour comercial
Gracias
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
Código fuente gratuito de xHarbour Comercial:
¿Dónde (enlace) descargaste el xHarbour comercial que estás usando? ¿Lo modificaste o es original?
Prueba este ejemplo e comente, pls.
Regards, saludos.
Code: Select all | Expand
https://github.com/xHarbour-org/xharbour/tree/main/xHarbourBuilder
Prueba este ejemplo e comente, pls.
Code: Select all | Expand
// C:\FWH\SAMPLES\RUSSI3.PRG
#include "Fivewin.ch"
FUNCTION Main()
IF .NOT. FILE( "PRUEBA.DBF" ) // la id permanece en la memoria? Si. ???
DBCREATE( "PRUEBA.DBF", { { "TEST", "+", 4, 0 }, ;
{ "ADRESS", "C", 40, 0 } } )
ENDIF
USE PRUEBA EXCLUSIVE NEW ALIAS PRUEBA
GO TOP
// DBZAP() -> Cual version de XHB Comercial?
IF .NOT. EOF()
WHILE( .NOT. EOF() )
SYSREFRESH()
IF EOF()
EXIT
ENDIF
RLOCK()
DELETE ALL
DBPACK()
COMMIT
UNLOCK
SKIP
ENDDO
BROWSE() // VACIO? Yes!
ENDIF
DBAPPEND()
RLOCK()
REPLACE ADRESS WITH "RUSSIMICRO1"
COMMIT
UNLOCK
DBAPPEND()
RLOCK()
REPLACE ADRESS WITH "RUSSIMICRO2"
COMMIT
UNLOCK
GO TOP
XBROWSE()
CLOSE DATABASE
RETURN NIL
// FIN / END - [email protected]
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
-
russimicro
- Posts: 413
- Joined: Sun Jan 31, 2010 3:30 pm
- Location: Bucaramanga - Colombia
Re: CAMPO AUTOINCREMENT - DBF [RESUELTO]
Karinha...
Funciono correcto... dado que no USAS el zap---
El problema es en xharbour.... Enrico ya lo soluciono en la version .org (version de oct 22 2025)
pero para el comercial(licenciado) ya no hay soporte...
Ahora no si alguien esta manteniendo ese codigo con la version liberada....
pero como estoy en proceso de pasar a xharbour.org y harbour , puedo por ahora funcionar sin usar el zap en la version comercial
Gracias
Funciono correcto... dado que no USAS el zap---
El problema es en xharbour.... Enrico ya lo soluciono en la version .org (version de oct 22 2025)
pero para el comercial(licenciado) ya no hay soporte...
Ahora no si alguien esta manteniendo ese codigo con la version liberada....
pero como estoy en proceso de pasar a xharbour.org y harbour , puedo por ahora funcionar sin usar el zap en la version comercial
Gracias