hbenade
25th August 2004, 12:43
I wrote a script which process transactions, it does contineous switch.to. company, it also then call a dll which insert rows into tdpur001, tdpur011,
tdpur010 etc, every now and then it give various 606 errors eg. Ref not exist tdpur010.ccon -> tccom001.emno, eg tdpur011.txta > tttxt001.ctext etc

I did some db.binds and unbinds on all tables in the dll, I have passed to company number from the script to the dll and do company switching inthe dll
This 606 errors still appear every now and then, Is there anything else that I can try

Sorry if I explain my self wrongly but, I think i have got a problem with
switching companies, according to the log.bshell, as i call the dll and want to update eg tdpur001 in the specific company it shows the another company

Thanks
Hans

günther
25th August 2004, 15:35
Hans,

error 606 is EREFNOTEXISTS.

You can do two things:
1. Before you insert/update tabale fields, you must check *all* field values according to the Reference Table (and Refernce Mode). So:
* tdpur001.suno must be present in your *destination* company in table tccom020
(.suno).
* tdpur001.comp in tcccom000(.ncmp).
and so far; have a look at Maintain Table Fields.

2. You can avoid BW Messages to popup, if you use

long ret
ret = db.insert(ttdpur001, db.retry, db.return.ref.not.exists)

you can handle errors within your application as well. See Database Handling / Error Handling in the Baan Help.

günther