FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bug FW_DBFTOEXCEL
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
bug FW_DBFTOEXCEL
Posted: Thu Jul 09, 2015 10:16 AM

Hello,

I get this error:

Error description: (DOS Error -2147352567) WINOLE/1006 (0x800A03EC): _VALUE
Args:
[ 1] = A { ... }

Stack Calls

Called from: => TOLEAUTO:_VALUE( 0 )
Called from: .\source\classes\DATABASE.PRG => (b)FW_DBFTOEXCEL( 1431 )

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FW_DBFTOEXCEL
Posted: Thu Jul 09, 2015 10:31 AM

Hello,

I think the problem is related to empty dates.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: bug FW_DBFTOEXCEL
Posted: Thu Jul 09, 2015 11:52 AM

Sí el error puede estar relacionado con fechas vacias.

http://fivetechsupport.com/forums/viewt ... 50#p169487

Parece que la solucion que dieron al problema en:

https://groups.google.com/forum/#!searc ... g4tZJLxQsJ

es esta:
oExcelSheet:Cells( 1, 1 ):Value := iif( Empty( dMyDate ), NIL, dMyDate )

Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug FW_DBFTOEXCEL
Posted: Thu Jul 09, 2015 02:30 PM

Hello,

Thank you. The problem is the function uses an Array:

if Empty( cFieldList )
cFieldList := ""
AEval( DbStruct(), { |a| cFieldList += "," + a[ 1 ] } )
cFieldList := Substr( cFieldList, 2 )
endif
aHead := HB_ATokens( cFieldList, "," )
nCols := Len( aHead )

bLine := &( "{||{" + cFieldList + "}}" )

DbEval( { || oRange:Rows( nRow ):Value := Eval( bLine ), nRow++ }, bFor, bWhile, nNext, nRec, lRest )

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: bug FW_DBFTOEXCEL
Posted: Fri Jul 10, 2015 01:12 AM

Exporting by rows is a lot faster than exporting cell by cell.
We can extend the codeblock to scan for empty dates and substituting with nulls. But this again defeats the main purpose of speed. When I first made this function it was working for empty dates also correctly with xHarbour. I think sometime back Harbour also made some changes regarding empty dates.

Anyway I need to check this once again and see what to do.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion