INDEXAR EM REDE : ERRO - WORKAREA NOT IN USE: __DBPACK
Enviado: 31 Jul 2007 15:04
Estou alterando minha rotina de criacao de indices, para funcionar agora em rede. A função que estou usando, eu achei aqui no forum, mas não estou conseguindo por em pratica.
Peço ajuda de voces. Obrigado!
EWERTON
Peço ajuda de voces. Obrigado!
EWERTON
Código: Selecionar todos
function indice()
MENS(" ATENCAO: TODOS OS USUARIOS DEVEM SAIR DO PROGRAMA")
TONE(900,9)
TONE(900,7)
TONE(900,9)
INKEY(0)
mens("DESEJA REALMENTE CONTINUAR? (S/N)?")
setcolor("b/b,B/B")
Cresp=space(1)
@ 23,78 get Cresp pict "@!" valid Cresp $ "SN"
read
If Cresp ="S"
save screen to index
dbcloseall()
valor:=0
ultimo:=171
termoh(valor)
t:=0
c:=0
if inlock("clientes.dbf")
alert("Arquivo travado")
else
use clientes exclusive
pack //ERRO AQUI
index on cod to ind_cod
mens("Indexando Arquivo 001 - Clientes")
valor=(++c)*100/ultimo
termoh(valor)
index on left(emp,10) to ind_emp
mens("Indexando Arquivo 002 - Clientes")
valor=(++c)*100/ultimo
termoh(valor)
endif
if inlock("fornecedor.dbf")
alert("arquivo travado")
else
use fornecedor excl
pack
index on codi to ind_codi
mens("Indexando Arquivo 001 - Fornecedores")
valor=(++c)*100/ultimo
termoh(valor)
index on left(emp1,10) to ind_emp1
mens("Indexando Arquivo 002 - Fornecedores")
valor=(++c)*100/ultimo
termoh(valor)
endif
etc
etc
dbcloseall()
restore screen from index
endif
If Cresp ="N"
MENS("OPERACAO FOI CANCELADA ! ")
RETURN
endif
return
*-----------------------------------------------------------------------------*
* PROGRAMA_____: TERMOH()
* FUNCAO_______: MOSTRA BARRA DE PORCENTAGEM P/ INDEXACAO DOS INDICES
* DATA_________:
* AUTOR________: EWERTON RODRIGO CARDOSO DA SILVA
*-----------------------------------------------------------------------------*
function termoh(valor)
IF valor <=1
setcolor("w+/r")
@ 13,11 SAY "ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ %"
else
setcolor("n/r")
@ 13,10 say replicate(chr(219),valor/2)
setcolor("w+/r")
@ 13,60 say valor pict "999"
endif
return
*-----------------------------------------------------------------------------*
* PROGRAMA_____: TERMAL()
* FUNCAO_______: MOSTRA BARRA DE PORCENTAGEM P/ RELATORIOS EM GERAL
* DATA_________:
* AUTOR________: EWERTON RODRIGO CARDOSO DA SILVA
*-----------------------------------------------------------------------------*
function termal(valor)
IF valor <=1
setcolor("w+/r")
@ 23,14 SAY "ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ %"
else
setcolor("b/r")// ("n/r")
@ 23,13 say replicate(chr(219),valor/2)
setcolor("w+/r")
@ 23,63 say valor pict "999"
endif
return
**------------------------------------------------------------------
function inlock(dbf)
ldbf:=fopen(dbf,1)
if ferror() <> 0
return .t.
endif
fclose(lbdf)
return .f.