<% oJSON=NEWOBJECT('json','json.prg') oresponse.expires=-1 SET NULL off SET DELETED ON ascdata=orequest.form('ascdata') *ascdata=STRTRAN(ascdata,[aaaa],[&]) theresponse='No Action' recordsadded=0 templocation=addbs(oprop.appstartpath)+'temp\' newtempfile=templocation+sys(2015)+'.dbf' IF NOT [NFJSON] $ SET("Procedure") SET PROCEDURE TO (addbs(oprop.appstartpath)+[prg\nfjson.FXP]) additive endif nfJsonToCursor(ascdata, 'newascdata',.f.) select [newascdata] tsql=[select * from newascdata where itemid+bar_code not in (select itemid+bar_code from (']+dbclocation+[asctable') ) into table ]+newtempfile &tsql newrecordsadded=_tally select [asctable] tsql=[append from (']+newtempfile+[')] &tsql *CURSORTOXML('tmpcursor','theresponse',1,0,0,'1') *oResponse.ContentType = "application/xml;charset=windows-1252" oresponse.Write('New ascociations received '+transform(newrecordsadded)) oresponse.flush CLOSE DATABASES CLOSE TABLES %>