[Solved]Error DBFCDX/1010 Read error

[Solved]Error DBFCDX/1010 Read error

Postby sambomb » Wed May 22, 2013 4:58 pm

Someone know why this kind of erro occurs? The DBF is simple, less than 10 records, no Index.

Log 1 wrote:
Code: Select all  Expand view

Application
===========
   Path and name: C:\rcalocal\CAIXA.EXE (32 bits)
   Size: ********* bytes
   Time from start: 0 hours 0 mins 2 secs
   Error occurred at: 22/05/2013, 05:15:10
   Error description: Error DBFCDX/1010  Read error: Z:\RCA\03293.DBF

Stack Calls
===========
   Called from:  => DBSKIP(0)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => VERIFICACAMPOSARQUIVOAUXILIAR(1318)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => VERIFICAARQUIVOAUXILIAR(206)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => OBTEMINFOAUXILIAR(843)
....

Variables in use
================
   Procedure     Type   Value
   ==========================
   DBSKIP
     Local   1:    U    
     Local   2:    U    
   VERIFICACAMPOSARQUIVOAUXILIAR
     Local   1:    A    Len:    3
     Local   2:    L    .F.
     Local   3:    L    .T.
   VERIFICAARQUIVOAUXILIAR
     Local   1:    C    "qâZTIPOC
RAZAOCdCNPJCIECIMCENDERECOCPTELEFONECRESPONSAC(LAUDOCECFCPREVENDACDAVNAOFISCCDAVNOECFCGERASINTCIDCLIENTECMARCAC(MODELOCFIRMWARECNRSERIECVOLUMEHDCGTCNRCAIXACINICIODIAC
DESCISSCNOMECMD5CDTMODIFIC
HRMODIFICPRINCIPALCVERSAOC
P¬*C¤A‰$¢T¸A«QªP"
VðR!Jô"DÈŸ'@Oª
B%)4nÌ™EÍÔ‘8P‚C‘PA@„d4C,CF_2iÈ ……dÒ‘h Âƒ,#–Œ…dÒ‘³Ç.Ü:ièÑ£8pä‘ÃgŒŸ:tK¬]êêªU äJêT.P–YÉEÒ¥XZŠÑóG;p-®´-®´-®´P‚-®´-®´-®´-®´5lÜácBÎÑ›¶ì@ª˜cÆ2ZÌPŒR¤•#$H!B„‰‘,L&rèÁó'=fô9tèᓧ9~3fÄ+HY-Š´P‚-®´-®´-®´-®´5lÜácBÎÑ›¶ì@ª˜cÆ2ZÌPŒR¤•#$H!B„‰‘$H€&rìéÓGÏ™>xÈ8|àé3ÇŽ:r3fÈ+HY-Š´P‚-®´-®´-®´-®´5lÜácBÎÑ›¶ìA¨À¹sä’8r˜Á“ÄPŒR¤•#$H!B„É-L€1'päñãǏž3v0vðÙƒ§Éœ83fÀ+HY-Š´P‚q

ZÔËQ¦"
’QJa.\ˆq‚
ʉ˜FB3fÆ•ˆqY"‘#Y‹:xœÁÃäN9zÈɃFO-Š´9P‚q
H–J´¨§Rž0d€L0`ÂÅÈ•Èq"
Y1.‰#&¢:xœÁÃäN9zÈÑÓFŽ-Š´9P‚q
JŠ„ä¨L‰°!¬Y±ÆT q‚YŒf°#D²Ä•V˜ˆ:xœÁÃäN9zÈÉóFÎ-®´9"
     Local   2:    L    .T.
   OBTEMINFOAUXILIAR
     Param   1:    C    "
TRCA"
     Param   2:    U    
     Param   3:    U    
     Param   4:    C    "
IE"
     Local   1:    A    Len:    0
     Local   2:    U    
     Local   3:    N    0
     Local   4:    L    .T.
     Local   5:    L    .F.
     Local   6:    C    "
"
     Local   7:    L    .F.

...

Linked RDDs
===========
   DBF
   DBFFPT
   DBFCDX
   DBFBLOB
   DBFNTX

DataBases in use
================

  1: => INFOPAF                            RddName: DBFCDX
     ==============================
     RecNo    RecCount    BOF   EOF
          8        17909      .F.   .F.

The DBF have less than 10 records

     Indexes in use                        TagName

     Relations in use



Log 2 wrote:
Code: Select all  Expand view

Application
===========
   Path and name: C:\rcalocal\CAIXA.EXE (32 bits)
   Size: ********* bytes
   Time from start: 0 hours 0 mins 7 secs
   Error occurred at: 22/05/2013, 05:24:07
   Error description: Error DBFCDX/1010  Read error: Z:\RCA\ARQAUX.DBF

Stack Calls
===========
   Called from:  => DBCREATE(0)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => CRIAARQUIVOAUXILIAR(247)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => (b)VERIFICAARQUIVOAUXILIAR(52)
   Called from: G:\FWH(10.6)\source\function\msgrun.prg => (b)MSGRUN(145)
   Called from: G:\FWH(10.6)\source\classes\dialog.prg => (b)TDIALOG:TDIALOG(86)
   Called from:  => TDIALOG:DISPLAY(0)
   Called from: G:\FWH(10.6)\source\classes\dialog.prg => TDIALOG:HANDLEEVENT(948)
   Called from:  => DIALOGBOXINDIRECT(0)
   Called from: G:\FWH(10.6)\source\classes\dialog.prg => TDIALOG:ACTIVATE(280)
   Called from: G:\FWH(10.6)\source\function\msgrun.prg => MSGRUN(151)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => VERIFICAARQUIVOAUXILIAR(52)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => OBTEMINFOAUXILIAR(843)
....
Variables in use
================
   Procedure     Type   Value
   ==========================
   DBCREATE
     Param   1:    C    "Z:\RCA\ARQAUX.DBF"
     Param   2:    A    Len:   30
     Local   1:    U    
     Local   2:    U    
   CRIAARQUIVOAUXILIAR
     Local   1:    A    Len:   30
   (b)VERIFICAARQUIVOAUXILIAR
     Local   1:    U    
   (b)MSGRUN
     Param   1:    U    
   (b)TDIALOG:TDIALOG
     Param   1:    O    Class: TDIALOG
   TDIALOG:DISPLAY
   TDIALOG:HANDLEEVENT
     Param   1:    N    15
     Param   2:    N    0
     Param   3:    N    0
     Local   1:    O    Class: TDIALOG
   DIALOGBOXINDIRECT
     Param   1:    N    4194304
     Param   2:    C    "€ È€     xÿ{ÿÆ      R e p a s s a n d o   a r q u i v o   a u x i l i a r        P      ¾  z S T A T I C   A g u a r d e         P     ¾
 { m s c t l s _ p r o g r e s s 3 2         "

     Param   3:    N    983526
     Param   4:    O    Class: TDIALOG
   TDIALOG:ACTIVATE
     Param   1:    U    
     Param   2:    U    
     Param   3:    U    
     Param   4:    L    .T.
     Param   5:    U    
     Param   6:    L    .T.
     Param   7:    B    {|| ... }
     Param   8:    U    
     Param   9:    U    
     Param  10:    L    .F.
     Local   1:    O    Class: TDIALOG
     Local   2:    N    983526
     Local   3:    U    
     Local   4:    U    
     Local   5:    U    
     Local   6:    O    Class: TDIALOG
   MSGRUN
     Param   1:    C    "Aguarde"
     Param   2:    C    "Repassando arquivo auxiliar"
     Param   3:    B    {|| ... }
     Local   1:    O    Class: TDIALOG
     Local   2:    O    Class: TPROGRESS
     Local   3:    O    Class: TSAY
     Local   4:    U    
     Local   5:    O    Class: TFONT
     Local   6:    N    90
     Local   7:    L    .T.
     Local   8:    O    Class: TTIMER
     Local   9:    N    8.5
     Local  10:    N    1
     Local  11:    N    7
   VERIFICAARQUIVOAUXILIAR
     Local   1:    C    "TRCA;CRAZAOSOCIAL=4UDF#ZN\[PVN^/YeSTBDFB¢CCNPJ=43:33>779>@<;?=B<HCBAHE¢CINSCRICAOESTADUAL=3LTJQ[TEJA¢CINSCRICAOMUNICIPAL=36197=29DID¢CENDERECO=4U/%FHUR[LX-YT[V\3W^ZlZbi`]lG?UZ?PAhhuy{vKVMtƒn€rtƒvSdU‹[f]mwrxopqusGEJI¢CTELEFONE=3538;=6A<;9FHF¢CNOMERESPONSAVEL=4UPSGPSNSWR-[X[YT\cd3dVki\CBDC¢CLAUDO=3SPQ3<5;7<;GEB¢
TPAF;LECF=.T.¢RAZAO=FERNANDELDROGASLTDA¢LPREVENDA=31U3BIF¢LDAVNAOFISCAL=31U3BIF¢LDAVRELGERENCIAL=31U3BIF¢LPDVGERASINTEGRA=31U3BIF¢
TECF;CIDCLIENTE=3347<:CHG¢CMARCA=3GbwxtfGCG¢CMODELO=3IT%975DFJ¢CFIRMWARE=34/5BFC¢CNUMEROSERIE=4GS5986KY;9=;?=CFKCEIBDBJ¢CVOLUMEHD=30366;7@>AACGEE¢LPREVENDA=31U3BIF¢LDAVNAOFISCAL=31U3BIF¢LDAVRELGERENCIAL=31U3BIF¢LINTERVENCAOTECNICA=31G3BHB¢LPDVGERASINTEGRA=31U3BIF¢NTOTALIZADORGERAL=35:>;?7=5?:FIF¢CNUMEROCAIXA=3317BFF¢DDATAINICIODIA=3#!4#'4)'+)EBA¢LDESCONTOISS=31G3BHB¢
TECF;CIDCLIENTE=3347<:CHG¢CMARCA=3GbwxtfGCG¢CMODELO=3IT%975DFJ¢CFIRMWARE=34/5BFC¢CNUMEROSERIE=4GS5986KY;9=;?=CFCAIIBDBD¢CVOLUMEHD=30359=6=?@@FGEG¢LPREVENDA=31U3BIF¢LDAVNAOFISCAL=31U3BIF¢LDAVRELGERENCIAL=31U3BIF¢LINTERVENCAOTECNICA=31G3BHB¢LPDVGERASINTEGRA=31U3BIF¢NTOTALIZADORGERAL=3557477A5;BFGG¢CNUMEROCAIXA=3316BFE¢DDATAINICIODIA=3#!4#'4)'+)EBA¢LDESCONTOISS=31G3BHB¢
TECF;CIDCLIENTE=3347<:CHG¢CMARCA=3GbwxtfGCG¢CMODELO=3IT%975DFJ¢CFIRMWARE=34/5BFC¢CNUMEROSERIE=4GS5986KY;9=;?=D?LCIEBDBE¢CVOLUMEHD=30387;9=>D:FHF¢LPREVENDA=31U3BIF¢LDAVNAOFISCAL=31U3BIF¢LDAVRELGERENCIAL=31U3BIF¢LINTERVENCAOTECNICA=31G3BHB¢LPDVGERASINTEGRA=31U3BIF¢NTOTALIZADORGERAL=3<2>4@=79DFCJ¢CNUMEROCAIXA=3318BFG¢DDATAINICIODIA=3#!4#'4)'+)EBA¢LDESCONTOISS=31G3BHB¢
TEXE;CNOME=3EBQFHT7LcN-HJF¢CMD5=473=E=8:<=<=NH>S?DJKKYKZZM[NRV_d`CDFC¢DDATAMODIFICACAO=220JI¢CHORAMODIFICACAO=1A¢LPRINCIPAL=31G3BHB¢CVERSAO=3;/8BGC¢
TEXE;CNOME=3FBN[H3N_P)HCC¢CMD5=4H9=699NILMO>GCWEWVEHMZ\P_]T`XRQWCEFG¢DDATAMODIFICACAO=220JI¢CHORAMODIFICACAO=1A¢LPRINCIPAL=31U3BIF¢CVERSAO=3;/8BGC¢
TEXE;CNOME=3GSTJHWRH9NeP/JII¢CMD5=45CH5L<@8>9A@B=FGLIXDKG[\\PcNTPZRCDDG¢DDATAMODIFICACAO=220JI¢CHORAMODIFICACAO=1A¢LPRINCIPAL=31G3BHB¢CVERSAO=3;/8BGC¢
"

     Local   2:    L    .T.
   OBTEMINFOAUXILIAR
     Param   1:    C    "TRCA"
     Param   2:    U    
     Param   3:    U    
     Param   4:    C    "IE"
     Local   1:    A    Len:    0
     Local   2:    U    
     Local   3:    N    0
     Local   4:    L    .T.
     Local   5:    L    .F.
     Local   6:    C    ""
     Local   7:    L    .F.

...

Linked RDDs
===========
   DBF
   DBFFPT
   DBFCDX
   DBFBLOB
   DBFNTX
 

DataBases in use
================
--> EMPTY <--


Functions listed in the log:

Code: Select all  Expand view

****************************************************************************
static procedure VerificaCamposArquivoAuxiliar()
****************************************************************************
*
* Verificar os campos existentes no arquivo auxiliar para funcionar da maneira nova
* Parametros:
* Retorno: Nenhum
*
* Autor: Samir
* 12/09/2012 - 09:53:23
*
****************************************************************************

local aInfo := Array(3), lAchou := .F., lOpen := .F.

   If LogArqAux(); LogEvents("ArquivoAuxiliar -> VerificaCamposArquivoAuxiliar()"); End

   //-- Abre o arquivo auxiliar
   If Select("INFOPAF") <= 0

      If !NET_USESUB(SZero(pCodCli,5),,,"INFOPAF",,,.T.)

         Msg("Erro ao abrir o Arquivo Auxiliar")
         Return .F.
         
      else
     
         lOpen := .T.

      end

   end

   Select INFOPAF
   DbGoTop()

   While !Eof()

      If SemCriptografia( FIELDFW0 ) = "TXTFIVEWIN"
     
         aInfo[1] := FIELDFW1 //-- Field renamed to show at fivetech forum
         aInfo[2] := FIELDFW2 //-- Field renamed to show at fivetech forum
         aInfo[3] := FIELDFW3 //-- Field renamed to show at fivetech forum

         lAchou := .T.

         While !Rec_Lock(); End

         DbDelete()
         
         unlock

         exit
         
      end

      DbSkip()

   end
   
   If lAchou

      Select INFOPAF
      DbGoTop()

      While !Eof()

         If SemCriptografia( FIELDFW0 ) = "TEXTOFORUMFIVEWIN"
            While !Rec_Lock(); End
            Replace FIELDFW1   with  aInfo[1]//-- Field renamed to show at fivetech forum
            Replace FIELDFW2   with  aInfo[2]//-- Field renamed to show at fivetech forum
            Replace FIELDFW3   with  aInfo[3]//-- Field renamed to show at fivetech forum
            unlock                
            lAchou := .T.

            exit

         end

         DbSkip()

      end

   end
   
   If lOpen
   
      DbCloseArea()

   end

Return Nil

/*------------------------------------------------------------------------*/

****************************************************************************
static function CriaArquivoAuxiliar()
****************************************************************************
*
* Criar o DBF do arquivo auxiliar e repassar as informações
* Parametros:
* Retorno: Nenhum
*
* Autor: Samir
* 17/01/2012 - 11:58:02
*
****************************************************************************

local aStruct := {}

   If LogArqAux(); LogEvents("ArquivoAuxiliar -> CriaArquivoAuxiliar()"); End

   Pause(2)

   aStruct := EstruturaArquivoAuxiliar()

   //-- Samir 30/01/2013 - INI

   If ConfirmaFErase(pDir+"ARQAUX.DBF",3)

      DbCreate(pDir+"ARQAUX.DBF",aStruct)
     
   else
   
      Msg("Erro ao repassar o arquivo auxiliar.")
      Return .F.
     
   end
   //-- Samir 30/01/2013 - FIM

   Pause(2,.T.)
   SysRefresh()

Return RepassaInfoArquivoAuxiliar()

/*------------------------------------------------------------------------*/

****************************************************************************
function EstruturaArquivoAuxiliar()
****************************************************************************
*
* Gerar uma matriz com a estrutua do arquivo auxiliar
* Parametros:
* Retorno: aStruct
*
* Autor: Samir
* 11/09/2012 - 16:59:22
*
****************************************************************************

local aStruct := {}

   If LogArqAux(); LogEvents("ArquivoAuxiliar -> EstruturaArquivoAuxiliar()"); End

   aAdd( aStruct, {"FLDFW_01", "C", 10, 0 } ) //-- Field names and sizes changed to post on the fivetech forum
   aAdd( aStruct, {"FLDFW_02", "C", 12, 0 } )
   aAdd( aStruct, {"FLDFW_03", "C", 14, 0 } )
   aAdd( aStruct, {"FLDFW_04", "C", 16, 0 } )
   aAdd( aStruct, {"FLDFW_05", "C", 18, 0 } )
   aAdd( aStruct, {"FLDFW_06", "C", 20, 0 } )
   aAdd( aStruct, {"FLDFW_07", "C", 22, 0 } )
   aAdd( aStruct, {"FLDFW_08", "C", 24, 0 } )
   aAdd( aStruct, {"FLDFW_09", "C", 26, 0 } )
   aAdd( aStruct, {"FLDFW_10", "C", 28, 0 } )
   aAdd( aStruct, {"FLDFW_11", "C", 30, 0 } )
   aAdd( aStruct, {"FLDFW_12", "C", 32, 0 } )
   aAdd( aStruct, {"FLDFW_13", "C", 34, 0 } )
   aAdd( aStruct, {"FLDFW_14", "C", 36, 0 } )
   aAdd( aStruct, {"FLDFW_15", "C", 38, 0 } )
   aAdd( aStruct, {"FLDFW_16", "C", 40, 0 } )
   aAdd( aStruct, {"FLDFW_17", "C", 42, 0 } )
   aAdd( aStruct, {"FLDFW_18", "C", 44, 0 } )
   aAdd( aStruct, {"FLDFW_19", "C", 46, 0 } )
   aAdd( aStruct, {"FLDFW_20", "C", 48, 0 } )
   aAdd( aStruct, {"FLDFW_21", "C", 50, 0 } )
   aAdd( aStruct, {"FLDFW_22", "C", 52, 0 } )
   aAdd( aStruct, {"FLDFW_23", "C", 54, 0 } )
   aAdd( aStruct, {"FLDFW_24", "C", 56, 0 } )
   aAdd( aStruct, {"FLDFW_25", "C", 58, 0 } )
   aAdd( aStruct, {"FLDFW_26", "C", 60, 0 } )
   aAdd( aStruct, {"FLDFW_27", "C", 62, 0 } )
   aAdd( aStruct, {"FLDFW_28", "C", 64, 0 } )
   aAdd( aStruct, {"FLDFW_29", "C", 66, 0 } )
   aAdd( aStruct, {"FLDFW_30", "C", 68, 0 } )

Return aStruct

/*------------------------------------------------------------------------*/

****************************************************************************
static function RepassaInfoArquivoAuxiliar()
****************************************************************************
*
* Repassar as informações do modelo antigo para o modelo novo
* Parametros:
* Retorno: Nenhum
*
* Autor: Samir
* 17/01/2012 - 12:01:43
*
****************************************************************************
Local cNomeArquivo := pDir + SZero(pCodCli,5) + ".DBF"
Local aLinhas := {}, i := 0, j := 0, cTipoLinha := "", aSub := {}
Local cLinha := "", cValor := "", nPos := 0

   //-- Abre o arquivo auxiliar
   If !NET_USESUB("ARQAUX",,"E","INFOPAF",,,.T.)
   
      Msg("Erro ao abrir o Arquivo Auxiliar")
      Return .F.
   
   else

      DbZap()

   end

   //-- Transformar o Txt em uma matriz para cada linha
   aLinhas := Explode( AllTrim( RemNaoImp( MemoRead(cNomeArquivo),,,.T. ) ),CRLF,.T.)

   If Len(aLinhas) = 0
   
      Msg("Nenhuma linha carregada")
     
      Return .F.
     
   elseif Len(aLinhas) <= 5
   
      Msg("Não existem linhas suficientes")
     
      Return .F.
     
   end
   
   //-- Repassar do TXT para Array
   For i := 1 to Len(aLinhas)

      //-- Quebra a linha no separador dos atributos
      aLinhas[i] := Explode(aLinhas[i],"SEPARADOR")//-- SEPARADOR Trocado para postagem no fórum Fivetech
     
      //-- Remover o tipo da linha do restante das informações
      cTipoLinha := Left(aLinhas[i,1],4)
      aLinhas[i,1] := SubStr(aLinhas[i,1],6)
     
      //-- Inicia a submatriz com o tipo
      aSub := {cTipoLinha}
     
      //-- Roda a linha pegando os atributos
      For j := 1 to Len(aLinhas[i])
     
         cLinha := aLinhas[i,j]
         
         nPos := At("=",cLinha)
         
         If nPos > 0
         
            cValor := SubStr(cLinha,nPos + 1)
           
            If !Empty( Descriptografa( cValor) )
           
               cValor := Descriptografa( cValor)
               
            end
           
            cLinha := SubStr(cLinha,1,nPos - 1) + "SEPARADOR" + cValor + "SEPARADOR"
           
         else
         
            Msg(cLinha,"Erro em cLinha")
           
            cLinha := ""
           
            Loop
         
         end
     
         aAdd(aSub,cLinha)
         
         cLinha := ""
     
      end
     
      //-- Joga para a matriz de linhas uma matriz com o tipo e os atributos
      aLinhas[i] := aSub
   
   end

   Select INFOPAF

   //-- Repassar do Array para DBF
   For i := 1 to Len(aLinhas)

      //-- Verifica se é uma linha válida
      If aLinhas[i,1] $ "FLAG1;FLAG2;FLAG3;FLAG4;"
     
         AddRec()
         
      else
     
         Msg("aLinhas["+Ut(i)+",1] = "+aLinhas[i,1],"Erro - Tipo inválido")
     
         Loop
         
      end
     
      //-- Verifica o tipo de repasse que deve ser feito
      If aLinhas[i,1] = "FLAG1"

         Replace TIPO   with  Encrypt( "FLAG1" )

         RepassaInfoArquivoAuxiliar1( aLinhas[i] ) //-- Just add record(s) and replace the pertinent data
     
      elseIf aLinhas[i,1] = "FLAG2"
     
         Replace TIPO   with  Encrypt( "FLAG2" )
     
         RepassaInfoArquivoAuxiliar2( aLinhas[i] ) //-- Just add record(s) and replace the pertinent data

      elseIf aLinhas[i,1] = "FLAG3"
     
         Replace TIPO   with  Encrypt( "FLAG3" )

         RepassaInfoArquivoAuxiliar3( aLinhas[i] ) //-- Just add record(s) and replace the pertinent data

      elseIf aLinhas[i,1] = "FLAG4"
     
         Replace TIPO   with  Encrypt( "FLAG4" )

         RepassaInfoArquivoAuxiliar4( aLinhas[i] ) //-- Just add record(s) and replace the pertinent data

      end
   
   end
   
   If RecCount() <= 5
   
      Msg("Não foram repassados registros suficientes")
     
   end
   
   //-- Gravar no arquivo
    DbCommitAll()
   
   DbCloseArea()

Return .T.

/*------------------------------------------------------------------------*/

****************************************************************************
function NET_USESUB(cFile, cIndex, cExcl, cAlias, lNovaArea, cSub)
****************************************************************************
*  Funcao.....: NET_USESUB
*  Autor......: Samir
*  Data.......: 12/05/10
*  Objetivo...: Abrir arquivos em ambiente multi-usuario na area corrente.
*  Parametro..: cFile   = Nome do DBF
*               cIndex  = Nome dos indices separados por virgulas ( ate 15 )
*               cExcl   = "E" abre em modo exclusivo. "" modo compartilhado
*               cAlias  = Alias a ser utilizado para o DBF
*               lNovaArea  = Se deve abrir o DBF em uma nova area
*               cSub    = Sub-diretório aonde está armazenado o DBF
****************************************************************************

// Arquivo EMPRESA deve ser usado no local.

local cTeste := "", nRetry := 1, lExcl := .F.

private  cCDX := ""

   Default lIgnoraADS := .F.

   //-- Definir um padrão para cSub
   If ValType(cSub) != "C"

      cSub := ""

   end

   //-- Formatar o parâmetro cSub caso necessário
   If !Empty(cSub)

      cSub := AllTrim(Upper(cSub))

      If Right(cSub,1) = "/"
         cSub := Left(cSub,Len(cSub)-1) + Chr(92)
      end

      If Right(cSub,1) != Chr(92)
         cSub := cSub + Chr(92)
      end

   end

   //-- Formatar a variável cFile
   cFile := UPPER(cFile)

   if Right(cFile,4) != ".DBF"
      cTeste := cFile+".DBF"
   else
      cTeste := cFile
   end

   //-- Preencher a variavel cTeste
    If At(":" + Chr(92),cSub) > 0

        cTeste := cSub + cTeste

    else

        cTeste := pDir + cSub + cTeste

    end

   //-- Definir valor padrão para o parâmetro lNovaArea
   if Valtype(lNovaArea) != "L"

        lNovaArea := .T.

   end

   //-- Verificar a existência do DBF
   if !file(cTeste)

      MsgInfo("Arquivo " + cTeste + " não existe.")

      return .f.

   end

   //-- Verificar se será aberto com exclusividade
   lExcl  := if(cExcl   == NIL .or. cExcl == "", .f., .t.)

   //-- Verificar se será aberto um indice
   cIndex := if(cIndex  == NIL, '', cIndex)

   //-- Verificar se é uma nova area
   if lNovaArea
     
        select 0

   end

   While .t.

      //-- Abrir o arquivo - Verificando modo exclusivo e se usará Alias
      if lExcl
         if cAlias == NIL
            use (cTeste) exclusive
         else
            use (cTeste) alias (cAlias) exclusive
         end
      else
         if cAlias == NIL
            use (cTeste)
         else
            use (cTeste) alias (cAlias)
         end
      end

      //-- Se conseguiu abrir sai do loop
      if used()
         exit
      end

      Msg(cTeste + " Bloqueado...  Libere-o.  <" +alltrim(str(nRetry++))+ " tentativa>;;")

      //-- Caso não tenha conseguido em x tentativas, sai do loop
      if nRetry >= 21
         exit
      end

   end

   //-- Se conseguiu abrir
   if used()

      cCDX := alltrim(parse(@cIndex))

      if .not. empty(cCDX)

            cCDX := pDir + cSub + cCDX

            If At(":" + Chr(92),cSub) > 0

                cCDX := cSub + cCDX

            else

                cCDX := pDir + cSub + cCDX

            end

         if !file(cCDX + ".CDX")

            Msg("Arquivo " + cCDX + ".CDX não existe.")

            USE

            return .f.

         end

      endif

        set index to (cCDX)

      return .t.

   else

      Msg("Arquivo " + cTeste + " não disponível.")

      return .f.

   end

Return .F.

/*------------------------------------------------------------------------*/

****************************************************************************
function ConfirmaFErase(cFile, nTentativas, lPergunta)
****************************************************************************
*
* Confirmar fErase fazendo nTentativas
* Parametros: cFile, nTentativas, lPergunta
* Retorno: lArquivoExiste
*
* Autor: Samir
* 25/10/2012 - 15:07:41
*
****************************************************************************

local lArquivoExiste := .T., nCont := 0

   Default  nTentativas := 0,;
            lPergunta := .F.

   Pause(1,.T.)
   SysRefresh()

   nCont := 0

   While File( cFile )

      fErase( cFile )

      Pause(1,.T.)
      SysRefresh()

      nCont++

      If lPergunta

         If File( cFile )

            If Sn("Arquivo " + cFile + " ainda existe, deseja continuar tentando deletar" )

               Loop

            else

               If nCont > 0

                  If nCont > nTentativas

                     Exit

                  end

               else

                  Exit

               end

            end

         else

            Exit

         end

      else

         If nCont > nTentativas

            Exit

         end

      end

   end

Return lArquivoExiste

/*------------------------------------------------------------------------*/

****************************************************************************
function Explode(cString, cSeparador, lAllTrim)
****************************************************************************
*
* Quebrar uma string nos separadores gerando uma matriz
* Parametros: cString
* Retorno: aArray
*
* Autor: Samir
* 27/10/2010 - 16:51:53
*
****************************************************************************

local aArray := {}, nLast := 1, nAt := 0, cInfo := ""

   Default cSeparador := ",", lAllTrim := .F.

   //-- Verificar a necessidade de remover espaços em branco
   If lAllTrim

      cString := AllTrim( cString )

   end

   //-- Obtem a posição do separador
   nAT := At(cSeparador,cString)

   //-- Verifica se é um texto válido
   If Empty(cString)

      Return aArray

   ElseIf nAt = 0

      aAdd(aArray,cString)

      Return aArray

   end

   //-- Enquanto houver um separador
   While nAt > 0

      cInfo := ""

      //-- Se o separador for o 1º caracter, avança para o proximo
      if nAt = 1

         cString  := SubStr(cString,nAt+Len(cSeparador))

         nAt      := At(cSeparador,cString)

         Loop

      end

      //-- Obter o conteudo
      cInfo    := SubStr(cString,1,nAt-1)

      //-- Verificar a necessidade de remover espaços em branco
      If lAllTrim

         cInfo := AllTrim( cInfo )

      end

      //-- Verificar a necessidade de remover espaços em branco
      If lAllTrim

         If nAt+Len(cSeparador) < Len(AllTrim(cString))

            cString  := AllTrim(SubStr(cString,nAt+Len(cSeparador)))
           
         else
         
            cString := ""
           
         end
           
      else

         If nAt+Len(cSeparador) < Len(cString)

            cString  := SubStr(cString,nAt+Len(cSeparador))

         else

            cString := ""
           
         end
         
      end

      //-- Obter a nova posição do separador
      If !Empty(cString)

         nAt := At(cSeparador,cString)

      else
     
         nAt := 0
     
      end

      //-- Verificar se é uma informação válida
      If !Empty(cInfo)

         //-- Adicionar na lista do retorno
         aAdd(aArray,cInfo)

      end

   end

   //-- Verificar a necessidade de remover espaços em branco
   If lAllTrim

      cString := AllTrim( cString )

   end

   //-- Verificar se existe um resto para ser adicionado
   If !Empty(cString)

      aAdd(aArray,cString)

   end

Return aArray

/*------------------------------------------------------------------------*/

****************************************************************************
function RemNaoImp(cTexto, lSemUso, lEspaco, lMantemCRLF)
****************************************************************************
*
* Remover caracteres não imprimiveis
* Parametros: cTexto, empty, lEspaco, lMantermCRLF
* Retorno: Result
*
* Autor: Samir
* 1/9/2009 - 10:16:59
*
****************************************************************************

local Result := "", i := 0

   Default cTexto := "", lSemUso := .F., lEspaco := .T., lMantemCRLF := .F.

   If lEspaco

      //-- Remove caracteres(Inclusive espaços)
      For i = 0 to 32
     
         If lMantemCRLF

            If i = 10 .Or. i = 13

               Loop

            End

         End

         cTexto := StrTran(cTexto,Chr(i))

      end

   else

      //-- Remove caracteres

      For i = 0 to 31

         cTexto := StrTran(cTexto,Chr(i))

         If lMantemCRLF

            If i = 10 .Or. i = 13

               Loop

            End
           
         End
         
      end
     
   end

    Result := cTexto

Return Result

/*------------------------------------------------------------------------*/
 
Last edited by sambomb on Mon May 27, 2013 5:36 pm, edited 1 time in total.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Enrico Maria Giordano » Wed May 22, 2013 5:15 pm

sambomb wrote:Error description: Error DBFCDX/1010  Read error: Z:\RCA\03293.DBF


The file Z:\RCA\03293.DBF can't be read. It could be a momentary fault in the network.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error DBFCDX/1010 Read error

Postby sambomb » Wed May 22, 2013 5:50 pm

Enrico Maria Giordano wrote:
sambomb wrote:Error description: Error DBFCDX/1010  Read error: Z:\RCA\03293.DBF


The file Z:\RCA\03293.DBF can't be read. It could be a momentary fault in the network.

EMG


Enrico, thx for the reply, the erro occurs only in this file so i'm seeking another possible error instead of network

1: => INFOPAF RddName: DBFCDX
==============================
RecNo__|_RecCount_|_BOF_|_EOF
__8____|_ 17909_|__.F._|_.F.

That thing is what worries me more, the File must have 10 records or less but this number is returning.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Enrico Maria Giordano » Wed May 22, 2013 6:05 pm

So the file is corrupted or anyway not correctly accessable.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error DBFCDX/1010 Read error

Postby sambomb » Wed May 22, 2013 6:19 pm

Enrico Maria Giordano wrote:So the file is corrupted or anyway not correctly accessable.

EMG


What could cause this?
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby lucasdebeltran » Wed May 22, 2013 6:27 pm

Hello,

Have you checked to have all rights / full control on permisions?.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Error DBFCDX/1010 Read error

Postby sambomb » Wed May 22, 2013 6:33 pm

Lucas, I didn't but as the error is intermittent, I excluded this hypothesis.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Enrico Maria Giordano » Wed May 22, 2013 7:28 pm

sambomb wrote:What could cause this?


A momentary fault on the network can still be the culprit.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error DBFCDX/1010 Read error

Postby Enrico Maria Giordano » Wed May 22, 2013 7:29 pm

Can you send me the corrupted table so I can check it here?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error DBFCDX/1010 Read error

Postby sambomb » Wed May 22, 2013 8:13 pm

Enrico, thx for trying.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Enrico Maria Giordano » Wed May 22, 2013 9:47 pm

As I wrote you by email, unfortunately I can't see anything wrong in your DBF.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error DBFCDX/1010 Read error

Postby HunterEC » Thu May 23, 2013 7:20 am

Norberto:

Try with a file name that begins with a letter. I do recall from old Clipper that sometimes the RDD had problems with file names that begin with numbers. I also encountered that intermittent problem under xHarbour.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Error DBFCDX/1010 Read error

Postby codemaker » Thu May 23, 2013 11:23 am

When opening the DBF file which name consists of all numbers ex. "12345678.DBF" you should use ALIAS also in the opening line:

cUserID := "1234"
cDbf2 := (cUserID + "_MAST")
USE (cDbf2) NEW SHARED ALIAS "somealias481"
IF !NETERR()
nMaster := SELECT()
SELECT(nMaster)
...
...

This made mi some problems when my clients used numeric UserID .... use of ALIAS solved my problem for good
I had this problem with xHarbour
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: Error DBFCDX/1010 Read error

Postby sambomb » Thu May 23, 2013 5:26 pm

HunterEC wrote:Norberto:

Try with a file name that begins with a letter. I do recall from old Clipper that sometimes the RDD had problems with file names that begin with numbers. I also encountered that intermittent problem under xHarbour.


codemaker wrote:When opening the DBF file which name consists of all numbers ex. "12345678.DBF" you should use ALIAS also in the opening line:

cUserID := "1234"
cDbf2 := (cUserID + "_MAST")
USE (cDbf2) NEW SHARED ALIAS "somealias481"
IF !NETERR()
nMaster := SELECT()
SELECT(nMaster)
...
...

This made mi some problems when my clients used numeric UserID .... use of ALIAS solved my problem for good
I had this problem with xHarbour



I open with a Alias without any number

Code: Select all  Expand view


// If !NET_USESUB(SZero(pCodCli,5),,,"INFOPAF",,,.T.) //-- ALIAS - "INFOPAF"

      //-- Abrir o arquivo - Verificando modo exclusivo e se usará Alias
      if lExcl
         if cAlias == NIL
            use (cTeste) exclusive
         else
            use (cTeste) alias (cAlias) exclusive
         end
      else
         if cAlias == NIL
            use (cTeste)
         else
            use (cTeste) alias (cAlias)
         end
      end
 
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Bayron » Thu May 23, 2013 5:55 pm

The problem has to be that another user is using the file in mode exclusive...
That will give you a read error...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests