Page 1 of 1

fw_exeltodbf error on execute

Posted: Mon Apr 20, 2020 11:12 pm
by Marc Venken
Hello,

I'm having folowing error with FW_EXCELTODBF

Code: Select all

  cCurFile := cGetFile( "Exel file| *.xl*| ", "Kies een leveranciers exel file (op drive d:)" )
  oRange   := GetExcelRange(  cCurfile , "Sheet1" ,  )
  xbrowse(oRange)

  ferase("basis.dbf")
  ferase("basis.cdx")

  aStruct := {}
  AADD(aStruct, { "code", "C", 15, 0 }) // Id
  AADD(aStruct, { "colnum", "C", 10, 0 }) // Id
  AADD(aStruct, { "kleuren", "C", 150, 0 }) // Id
  AADD(aStruct, { "picture", "C", 250, 0 }) // Id
  AADD(aStruct, { "code", "C", 15, 0 }) // Id  // Artcode + kleur ID (101)
  AADD(aStruct, { "imgtype", "C", 5, 0 }) // Id

  DbCreate( "basis.dbf", aStruct)

  use basis alias source NEW
  select source

  FW_ExcelToDBF( oRange, NIL , .t. )

  xbrowse("source")

 
Application
===========
Path and name: C:\Maveco_32_bit\TEST.EXE (32 bits)
Size: 5,648,384 bytes
Compiler version: Harbour 3.2.0dev (r1506171039)
FiveWin version: FWH 19.12
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 43 secs
Error occurred at: 21/04/2020, 00:59:55
Error description: Error BASE/1102 Argument error: UPPER
Args:
[ 1] = U

Stack Calls
===========
Called from: => UPPER( 0 )
Called from: .\source\function\DBFFUNC2.PRG => (b)FW_ARRAYTODBF( 408 )
Called from: => ASCAN( 0 )
Called from: .\source\function\DBFFUNC2.PRG => FW_ARRAYTODBF( 408 )
Called from: .\source\function\DBFFUNC2.PRG => FW_EXCELTODBF( 271 )
Called from: .\maveco.PRG => FALKATT( 14094 )
Called from: .\maveco.PRG => (b)BUILDMENU( 504 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1556 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1097 )
Called from: .\maveco.PRG => MAIN( 211 )

System
======
CPU type: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2592 Mhz

Re: fw_exeltodbf error on execute

Posted: Mon Apr 20, 2020 11:22 pm
by Marc Venken
It is clear that is has something todo with the fact that in the exel file there is a column with a numeric value in the rows or
that this column is changed to tekst.

If I use a other column with the same headernaam than it works ??

Re: fw_exeltodbf error on execute

Posted: Wed Apr 22, 2020 4:58 pm
by nageswaragunupudi

Code: Select all

FW_ExcelToDBF( oRange, NIL , .t. )
When you specify the 3rd parameter as .T., you are indicating that the First Row of the ExcelData are headers and that they are the field names for export.

In that case, all the cells of the first row should be Text and not empty.