>cFile = "c:\phc24\dossiers.xml" >adapter = CREATEOBJECT("XMLAdapter") >adapter.LoadXML(cFile,.T.) >adapter.tables(1).ToCursor() >>But i receive this error:
XMLTOCURSOR("c:\phc24\dossiers.xml")If this fails.
XMLTOCURSOR("c:\phc24\dossiers.xml")i have no error.
Local loJson Local lcJsonStr Local lnSuccess Local loartigos Local lnNumArtigos Local i Local loArtObj Local lnDos Local lnContador Local lnArm Local lnCl Local lnEstabt lnCl = 443 lnEstab = 7 &&Loja ECI Gaia lnDos = 323 &&Sales Report lnCl_l = 50002 &&80001 lnEstab_l = 0 &&0 &&Loja ECI Gaia lnDos_l = 323 &&340 &&Sales Report lnContador = 0 lnArm = 91 &&113 &&Loja ECI Gaia *!* Qual a data da ultima alteração Create Cursor xVars ( no N(5), tipo c(1), Nome c(40), Pict c(100), lOrdem N(10), tbVal m, nValor N(18,5), cValor c(250),mValor m, lValor l, dValor d ) Select xVars Append Blank Replace xVars.no With 1 Replace xVars.tipo With "D" Replace xVars.Nome With "Desde a Data" Replace xVars.Pict With "##.##.####" Replace xVars.lOrdem With 1 Replace xVars.dValor With (Date() - 1) m.mCaption = "Artigos alterados desde a datas...?" m.escolheu=.F. docomando("do form usqlvar with 'xvars',m.mCaption") If m.escolheu=.T. Select xVars Go Top Locate For xVars.no=1 pd_data=xVars.dValor If datavazia(xVars.dValor) pd_data = Date()-1 Endif If pd_data <= Ctod('31.01.2020') msg("Não pode importar entradas com data inferior a 31-01-2020") Else Try Xmltocursor('dossiersnovo.xml','dossiersnew',512) *browse lnNumDossiers = Reccount("dossiersnew") Catch To oError When .T. lnNumDossiers=0 msg("Não existem nada a importar!") Endtry If lnNumDossiers > 0 * Criar cursor para conteudo do ficheiro Create Cursor crstmp (bostamp c(25), bistamp c(25), dataobra d ,ref c(18), qtt N(19,6), lote c(40), obrano c(10), lOrdem N(10), Design c(60)) Select dossiersnew Scan *!* If Alltrim(dossiersnew.u_glnentr) = '5600000025963' And VAL(dossiersnew.qtt) <> 0 ««««--Probelm When i use this IF Select crstmp Append Blank Replace crstmp.dataobra With Ctod(Substr(dossiersnew.dataobra,9,2) +'.'+Substr(dossiersnew.dataobra,6,2) +'.'+Substr(dossiersnew.dataobra,1,4)) Replace crstmp.bostamp With Alltrim(dossiersnew.bostamp) Replace crstmp.bistamp With Alltrim(dossiersnew.bistamp) Replace crstmp.ref With Alltrim(dossiersnew.ref) Replace crstmp.qtt With dossiersnew.qtt Replace crstmp.lote With Alltrim(dossiersnew.lote) Replace crstmp.obrano With astr(dossiersnew.obrano) Replace crstmp.Design With Alltrim(dossiersnew.Design) Replace crstmp.lOrdem With dossiersnew.lOrdem *!* Endif Endscan * Criar dossier por bostamp distinto. Select crstmp browse ««« - Work ok and return the data return
the error occur when using the IF With " VAL(dossiersnew.qtt) <> 0 " after SCAN: If Alltrim(dossiersnew.u_glnentr) = '5600000025963' And VAL(dossiersnew.qtt) <> 0 Note : if i use only : If Alltrim(dossiersnew.u_glnentr) = '5600000025963' , that work fine ! Linha: 76 Mensagem 1: Function argument value, type, or count is invalid. Mensagem 2: create cursor dossiersnew from array _XMLArray_B8468283_C239_4DA8_B4B2_49FAD15EB656_Many thanks,