[Solved]Error DBFCDX/1010 Read error

Re: Error DBFCDX/1010 Read error

Postby sambomb » Thu May 23, 2013 6:15 pm

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


Check the function NetUseSub()
Code: Select all  Expand view  RUN

   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() //-- Check this Bayron
         exit
      end

      Msg(cTeste + " Bloqueado...  Libere-o.  <" +alltrim(str(nRetry++))+ " tentativa>;;") //-- File blocked, release. 01..20 (st,nd,rd,th)

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

   end
 
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby ADutheil » Thu May 23, 2013 8:49 pm

Did you check disk integrity?
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Error DBFCDX/1010 Read error

Postby sambomb » Thu May 23, 2013 11:13 pm

ADutheil wrote:Did you check disk integrity?

How can I do that?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby ADutheil » Thu May 23, 2013 11:16 pm

Open a prompt box and execute chkdsk (/? for help). You´ll probably be asked (chkdsk c: /R) to reboot to have the test done at startup.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Error DBFCDX/1010 Read error

Postby sambomb » Thu May 23, 2013 11:58 pm

ADuthel, o erro só acontece nesse arquivo e ele já foi trocado(mais de uma vez), então é no mínimo improvável que seja esse o erro...
Mas vou requisitar que faça o teste.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Bayron » Fri May 24, 2013 1:55 am

sambomb wrote:
Bayron wrote:The problem has to be that another user is using the file in mode exclusive...
That will give you a read error...


Check the function NetUseSub()
Code: Select all  Expand view  RUN

   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() //-- Check this Bayron
         exit
      end

      Msg(cTeste + " Bloqueado...  Libere-o.  <" +alltrim(str(nRetry++))+ " tentativa>;;") //-- File blocked, release. 01..20 (st,nd,rd,th)

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

   end
 


Well, where is lExcl comming from???

I am guesing that you are forcing it to open in exclusive mode or not, but if the database is open by someone else either in exclusive or shared mode, you won't be able to open it in exclusive mode... And if is open in exclusive mode by someone, you wouldn't be able to open it either in exclusive nor shared mode...
=====>

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

Re: Error DBFCDX/1010 Read error

Postby ADutheil » Fri May 24, 2013 2:01 am

Bayron,

lExcl is defined earlier in the function

Code: Select all  Expand view  RUN
lExcl  := if(cExcl   == NIL .or. cExcl == "", .f., .t.)


I noticed he is passing 7 params to the function while it´s expecting only 6 but that should not make any difference.

Code: Select all  Expand view  RUN
!NET_USESUB(SZero(pCodCli,5), , ,"INFOPAF", , ,.T.)//NET_USESUB(cFile, cIndex, cExcl, cAlias, lNovaArea, cSub)
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Error DBFCDX/1010 Read error

Postby ADutheil » Fri May 24, 2013 2:09 am

Samir,
is the value of local 1 from function VERIFICAARQUIVOAUXILIAR expected or is it garbage?

Code: Select all  Expand view  RUN
"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"
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Error DBFCDX/1010 Read error

Postby sambomb » Fri May 24, 2013 8:30 am

ADutheil wrote:Bayron,

lExcl is defined earlier in the function

Code: Select all  Expand view  RUN
lExcl  := if(cExcl   == NIL .or. cExcl == "", .f., .t.)


I noticed he is passing 7 params to the function while it´s expecting only 6 but that should not make any difference.

Code: Select all  Expand view  RUN
!NET_USESUB(SZero(pCodCli,5), , ,"INFOPAF", , ,.T.)//NET_USESUB(cFile, cIndex, cExcl, cAlias, lNovaArea, cSub)

The last parameter I removed when I post on the forum because it does not influence anything, this parameter is only used because of a directive of another project that leverages the same PRG.

Algo como:
Code: Select all  Expand view  RUN
NET_USESUB(SZero(pCodCli,5), , ,"INFOPAF", , ,.T.)

Function NET_USESUB(cFile, cIndex, cExcl, cAlias, lNovaArea, cSub, lParametro)

#IFDEF __OUTROPROJETO__
   If lParametro
     //-- Outros tratamentos
   End
#ENDIF




ADutheil wrote:Samir,
Is the value of local 1 from function VERIFICAARQUIVOAUXILIAR expected or is it garbage?

Code: Select all  Expand view  RUN
"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"


I use MemoRead in the file to be able to identify whether it is a TXT or DBF. In this case is a DBF, then it is expected to show trash-like information.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Bayron » Fri May 24, 2013 3:06 pm

Well, where is lExcl comming from???


This is what I am saying:
lExcl is coming from cExcl, which is forced to be exclusive or shared without verificating if the database is already open by another user...

From earlier post, you stated that you are using the database in a network, which makes me think there are more than one user...

When you open the database, you force it to open the way you want, without knowing if it is used:
Code: Select all  Expand view  RUN

      if lExcl  //You forced it to open in Exclusive mode without knowing if it's open by some one else... If it is, you will get an error...
         if cAlias == NIL
            use (cTeste) exclusive
         else
            use (cTeste) alias (cAlias) exclusive
         end
      else   //If not Exclusive, you open in Shared mode... But if it is open by someone else in exclusive mode, you will get an error...
         if cAlias == NIL
            use (cTeste)
         else
            use (cTeste) alias (cAlias)
         end
      end
//This is the reason that you only get error in some situations and not all the time...
 


I think this should be the problem...
I see that you only try to open the auxiliary database in Exclusive mode...

Use:
TRY
CATCH

Or verify if the database is already open by someone else...(I can't help you with that)
=====>

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

Re: Error DBFCDX/1010 Read error

Postby sambomb » Fri May 24, 2013 4:49 pm

Bayron wrote:
Well, where is lExcl comming from???


This is what I am saying:
lExcl is coming from cExcl, which is forced to be exclusive or shared without verificating if the database is already open by another user...

From earlier post, you stated that you are using the database in a network, which makes me think there are more than one user...

When you open the database, you force it to open the way you want, without knowing if it is used:
Code: Select all  Expand view  RUN

      if lExcl  //You forced it to open in Exclusive mode without knowing if it's open by some one else... If it is, you will get an error...
         if cAlias == NIL
            use (cTeste) exclusive
         else
            use (cTeste) alias (cAlias) exclusive
         end
      else   //If not Exclusive, you open in Shared mode... But if it is open by someone else in exclusive mode, you will get an error...
         if cAlias == NIL
            use (cTeste)
         else
            use (cTeste) alias (cAlias)
         end
      end
//This is the reason that you only get error in some situations and not all the time...
 


I think this should be the problem...
I see that you only try to open the auxiliary database in Exclusive mode...

Use:
TRY
CATCH

Or verify if the database is already open by someone else...(I can't help you with that)


The file that is open isn't shared ( it's located on C:\RCALOCAL\ )
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Bayron » Fri May 24, 2013 5:04 pm

I am confused:
Code: Select all  Expand view  RUN
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  //<-----------------------
 


Here is saying something else... ( Read error: Z:\RCA\ARQAUX.DBF  )
Try to use the full path to open the database files...
=====>

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

Re: Error DBFCDX/1010 Read error

Postby sambomb » Fri May 24, 2013 5:36 pm

Bayron wrote:I am confused:
Code: Select all  Expand view  RUN
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  //<-----------------------
 


Here is saying something else... ( Read error: Z:\RCA\ARQAUX.DBF  )
Try to use the full path to open the database files...


Yes, you are right!
I'm sorry, I forgot to update the info.

After some tips I decided to move the file to a local directory and the same error happened again.


Code: Select all  Expand view  RUN

Application
===========
   Path and name: C:\rcalocal\CAIXA.EXE (32 bits)
   Size: ********* bytes
   Time from start: 0 hours 0 mins 3 secs
   Error occurred at: 24/05/2013, 05:39:44
   Error description: (DOS Error 38) DBFCDX/1010  Read error: C:\RCALOCAL\03293.DBF

Stack Calls
===========
   Called from:  => DBSKIP(0)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => VERIFICACAMPOSARQUIVOAUXILIAR(1334)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => VERIFICAARQUIVOAUXILIAR(208)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => OBTEMINFOAUXILIAR(845)


//------------------------------------------------------------------------------------------------------------------------------------//

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

Stack Calls
===========
   Called from:  => DBCREATE(0)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => CRIAARQUIVOAUXILIAR(249)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => (b)VERIFICAARQUIVOAUXILIAR(54)
   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(54)
   Called from: G:\prog\fivewin\SHARED8.3\ArquivoAuxiliar.prg => OBTEMINFOAUXILIAR(845)

 
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Error DBFCDX/1010 Read error

Postby Rick Lipkin » Fri May 24, 2013 5:57 pm

Samir

I noticed that you have linked into your program from the error.log DBFCDX,DBFFPT and I am sure somewhere at the top of your program you have defined ..
Code: Select all  Expand view  RUN

REQUEST DBFCDX
rddsetdefault ( "DBFCDX" )
 


Also ( and some people may argue with me ) .. when I open a .dbf I specify it with the clause
Code: Select all  Expand view  RUN

via "DBFCDX"
 

Here is my Netuse() function that works quite well for me .. not as sophisticated as yours but perhaps you can review and consider how I am opening a dbf.

Also as mentioned earlier .. I get the default location of the .exe and then make sure I SET DEFA to the .exe location .. and it does not matter if the path comes from a UNC or a mapped drive letter.
Code: Select all  Expand view  RUN

//-- get timestamp on .exe //

cFILE := GetModuleFileName( GetInstance() )
aDIR  := DIRECTORY( cFILE )
dEXE  := aDIR[1] [3]

// where .exe started from is default directory //

nSTART := RAT( "\", cFILE )
cDEFA  := SUBSTR(cFILE,1,nSTART-1)

aDIR   := NIL

SET DEFA to ( cDEFA )


Code: Select all  Expand view  RUN

//------------------------------
Func NETUSE( CDATABASE, LOPENMODE, NSECONDS )

LOCAL FOREVER, RESTART, WAIT_TIME, YESNO

RESTART := .T.
FOREVER := ( NSECONDS := 0 )
YESNO   := {"Yes" , "No"}

DO WHILE RESTART

   WAIT_TIME := NSECONDS

   DO WHILE ( FOREVER .OR. WAIT_TIME > 0 )

      IF LOPENMODE
         USE ( CDATABASE ) via "DBFCDX" EXCLUSIVE
      ELSE
         USE ( CDATABASE ) via "DBFCDX" SHARED
      ENDIF

      IF .NOT. NETERR()
         RETURN(.T.)
      ENDIF
      INKEY(1)
      WAIT_TIME--

   ENDDO

   * lock failed, ask to continue

   IF MsgYesNo( "Cannot lock " + CDATABASE + ", retry ?" )
   ELSE
      EXIT
   ENDIF

ENDDO

RETURN(.F.)
 


If Netuse( cDefa+"\Table.Dbf",.f.,5)

cDefa is the .exe location .. can be a logical drive or UNC G:\Folder or \\server\volume\Folder
First logical is Shared or Exclusive and the last parameter is the TimeOut before error.

Don't know if any of this will help..

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Error DBFCDX/1010 Read error

Postby sambomb » Fri May 24, 2013 7:12 pm

I open hundreds of files with this function in hundreds of clients every day!
I think that the error is somewhere else, some kind of virus or another odd error...

The error is intermitent (only on the first run of the day, if I recover a copy of the exe the error ceases), happens only in this client, changing the file from server to a local address doesn't change the error.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 17 guests