hola amigos
quiero abrir una dbf con un alias y me da un error de apertura, estoy casi seguro que es por los indices que usa
Hace tiempo Mr.Rao habia explicado cual era el error en la construcción del indice que ocasionaba este problema, creo que eso ocurre cuando se incluye en la construccion del indice el nombre de la base de datos...alguien se acuerda de esto ?
abrazo
problema abriendo dbf con alias
- karinha
- Posts: 7942
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: problema abriendo dbf con alias
Funciona de 1000.
https://imgur.com/UQxRdAp

Regards, saludos.
Code: Select all | Expand
#Include "Fivewin.Ch"
// LOCAL lPack := .T.
FUNCTION Indexar()
AEVAL(DIRECTORY( "CADGRUPO.cdx" ),{ |aFILE| FERASE(aFILE[F_NAME]) } )
USE CADGRUPO NEW EXCLUSIVE ALIAS CADGRUPO
IF lPack = .T. // checkbox en dialogo
PACK
ENDIF
oMeter1:nTotal = RecCount()
INDEX ON VAL(Field->GRUPOCOD) TAG GRUPOCOD TO CADGRUPO ;
FOR .NOT. DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
INDEX ON Field->GRUPODESCR TAG GRUPODESCR TO CADGRUPO ;
FOR .NOT. DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
INDEX ON Field->GRUPONOME TAG GRUPONOME TO CADGRUPO ;
FOR .NOT. DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
CLOSE DATABASE
AEVAL(DIRECTORY( "CADORSER.cdx" ),{ |aFILE| FERASE(aFILE[F_NAME]) } )
USE CADORSER NEW EXCLUSIVE ALIAS CADORSER
IF lPack = .T.
PACK
ENDIF
oMeter1:nTotal = RecCount()
INDEX ON VAL(Field->TPSERCOD) TAG TPSERCOD TO CADORSER ;
FOR .NOT. DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
INDEX ON Field->TPSERNOME TAG TPSERNOME TO CADORSER ;
FOR .NOT. DELETED() ;
EVAL ( oMeter1:Set( RecNo() ), CursorWait(), SysRefresh() ) ;
EVERY 10
CLOSE DATABASE
//... continua.
RETURN NIL
FUNCTION APERTURA_BANCOS()
PUBLIC DBCADGRUPO // asi para todos.
IF NETERR()
MsgStop( "ERRO DE REDE. IMPOSSÍVEL ABRIR OS BANCOS DE DADOS", ;
"Atençao, Erro de Rede. Verifique o Servidor... " )
RETURN NIL
ENDIF
HB_GCALL( .F. )
USE CADGRUPO NEW SHARED ALIAS CADGRUPO
GO TOP
DBCADGRUPO := ALIAS()
//... continua...
RETURN NIL
https://imgur.com/UQxRdAp

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- karinha
- Posts: 7942
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
- nageswaragunupudi
- Posts: 10722
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: problema abriendo dbf con alias
Never build an index like this:
When you open the dbf CUSTOMER with another alias name, the RDD can not find the alias CUSTOMER and you get an error.
Unfortunately if there is another DBF open with the alias "CUSTOMER" in another areay, your index will run on another area
Best practice is not to use "->" while building indexes.
Recommended:
Note:
field ...
is a declaration like local, static
Code: Select all | Expand
INDEX ON CUSTOMER->CITY ....
When you open the dbf CUSTOMER with another alias name, the RDD can not find the alias CUSTOMER and you get an error.
Unfortunately if there is another DBF open with the alias "CUSTOMER" in another areay, your index will run on another area
Best practice is not to use "->" while building indexes.
Recommended:
Code: Select all | Expand
field CITY,STATE, ....
INDEX ON CITY TAG CITY
INDEX ON STATE TAB STATE
...
Note:
field ...
is a declaration like local, static
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India