Tengo un error al tratar de usar la ImportFromDBF....estoy usando las dbf del directorio samples con este codigo. Puse las tablas en un array
- Code: Select all Expand view
- #include "FiveWin.ch"
//----------------------------------------------------------------//
REQUEST DBFCDX
function Main()
local cHost := "localhost"
local cUser := "root"
local cPassword := "1234"
local oCn,nSecs, uRet, cTable, aTables
local cDb := "fwh"
? "Connect to Server"
FWCONNECT oCn HOST cHost USER cUser PASSWORD cPassword
if oCn == nil
? "Connect Fail"
return nil
else
endif
if oCn != nil
? "Selecting database " + cDB, "Create if new"
if Empty( oCn:ListDbs( cDb ) )
oCn:CreateDB( cDb, "latin1" )
endif
oCn:SelectDB( cDB )
? "Connected to " + oCn:CurrentDB()
aTables := HB_dirScan( ".\", "*.dbf", "A" )
XBrowse( aTables )
for each cTable in aTables //{ "customer.dbf", "states.dbf" }
if ! oCn:TableExists( cFileNoExt( cTable ) )
? "Importing " + cTable
nSecs := Seconds()
uRet := oCn:ImportFromDBF( cTable )
nSecs := Seconds() - nSecs
? uret
? "Imported in ", nSecs, "Seconds"
endif
next
endif
? "IMPORTACION FINALIZADA"
oCn:Close()
return nil
//----------------------------------------------------------------//
Aca el error
Application
===========
Path and name: C:\fwh\samples\mysql01.exe (32 bits)
Size: 3,906,560 bytes
Compiler version: Harbour 3.2.0dev (r1603082110)
FiveWin version: FWH 17.01
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 11/13/17, 13:37:16
Error description: Error BASE/1108 Argument error: AT
Args:
[ 1] = C :
[ 2] = A { ... } length: 5
Stack Calls
===========
Called from: => AT( 0 )
Called from: .\source\function\FILENAME.PRG => CFILENOPATH( 48 )
Called from: .\source\function\FILENAME.PRG => CFILENOEXT( 68 )
Algun advise ?