bug FW_DBFTOEXCEL

Post Reply
MOISES
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

bug FW_DBFTOEXCEL

Post by MOISES »

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
MOISES
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: bug FW_DBFTOEXCEL

Post by MOISES »

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
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: bug FW_DBFTOEXCEL

Post by hmpaquito »

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 )
MOISES
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: bug FW_DBFTOEXCEL

Post by MOISES »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: bug FW_DBFTOEXCEL

Post by nageswaragunupudi »

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
Post Reply