<% file_reference=orequest.form('file_reference') if isnull(file_reference) file_reference=orequest.querystring('fref') endif record_number=orequest.form('record_number') if isnull(record_number) record_number=allt(transform(nvl(orequest.querystring('rref'),''))) endif if isnull(record_number) or empty(record_number) theresponse='{"status":"success","message":"No need","fref":"'+file_reference+'","rref":"'+record_number+'","eno":"'+new_enumber+'"}' return theresponse endif new_enumber=orequest.form('new_enumber') if isnull(new_enumber) new_enumber=allt(transform(nvl(orequest.querystring('eno'),''))) endif file_reference=allt(transform(file_reference)) record_number=allt(transform(record_number)) new_enumber=allt(transform(new_enumber)) tfilename=dbclocation+[details] tcmd=[select register from (']+tfilename+[') where allt(reffid)==']+file_reference+[' and recno()==val(']+record_number+[') into cursor ex ] tfile=addbs(oprop.appstartpath)+[temp\error.err] erase (tfile) Strtofile(tcmd,tfile) &tcmd if _tally=0 or not empty(register) theresponse='{"status":"success","message":"No need","fref":"'+file_reference+'","rref":"'+record_number+'","eno":"'+new_enumber+'"}' return theresponse endif if not empty(new_enumber) and not empty(record_number) tcmd=[update (']+tfilename+[') set REGISTER=']+new_enumber+[' where allt(reffid)==']+file_reference+[' and recno()==val(']+record_number+[') and empty(REGISTER) ] tfile=addbs(oprop.appstartpath)+[temp\new_enumber.err] *erase (tfile) *Strtofile(tcmd,tfile) &tcmd theresponse='{"status":"success","message":"registration saved successfully","fref":"'+file_reference+'","rref":"'+record_number+'","eno":"'+new_enumber+'"}' tfile=addbs(oprop.appstartpath)+[temp\new_reg.json] erase (tfile) Strtofile(theresponse,tfile) else theresponse='{"status":"success","message":"No need","fref":"'+file_reference+'","rref":"'+record_number+'","eno":"'+new_enumber+'"}' endif return theresponse %>