File ODO has 4 records. The first 3 records are written to the MySQL Data Base. Writing the fourth record branches to the ERR; Statement and reports "1st Error Message with EXCP=ERR on WRITE STATEMENT" If I remove the EXCP on the WRITE Statement and re-run the program I get the second error "2ND Message without EXCP on WRITE STATEMENT" Here is the code NEXTREC: READ (ODO,OrderRec) EXCP=NextFl WRITE (SqlLun, OrderRecw) EXCP = ERR !*** EXCP=WriteErr WriteCont: GOTO NextRec NextFl: ! DBClose: result$ = Control( SqlLun, "DISCONNECT" ) Close( SqlLun ) ! Bott2: RETURN ERR: error$ = Control( SqlLun, "GETLASTERROR" ) print result$; " >> "; error$ wait goto NEXTREC 6700 OrderRec: FORMAT _ 6705 Source$;_ 6710 Ornbr$;_ 6715 Cname$;_ 6720 Cadr1$;_ 6730 Ccity$;_ 6735 Cstate$;_ 6740 Czip$;_ 6741 Ostate$;_ 6745 Ocornbr$;_ 6750 Orornbr$;_ 6755 Osnbr1$;_ 6760 Zdateser;_ 6765 Invcnbr$;_ 6770 Invdtser;_ 6775 Otaxamt;_ 6780 Taxpct64;_ 6785 Net;_ 6790 Email1$;_ 6795 Email2$;_ 6800 Email3$;_ 6805 Oemlopa$;_ 6810 Oemlsa$;_ 6815 Oemlfi$;_ 6820 Emailedcustflg$;_ 6825 Emailedrepflg$;_ 6830 Emailedresaleflg$;_ 6835 Emailr$;_ 6840 Emailr2$;_ 6841 Type2$;_ 6842 Type3$;_ 6845 Docnum$ 6850 ! 6860 LENGTH 1 & LOCAL DEFAULT$ !Equals “@FF@” 6870 ! 6880 OrderRecw: FORMAT _ 6882 Default$;_ !Date Time Stamp 6884 Default$;_ !Auto Increment 6890 Source$;_ 6900 Ornbr$;_ 6910 Cname$;_ 6920 Cadr1$;_ 6930 Ccity$;_ 6940 Cstate$;_ 6950 Czip$;_ 6960 Ostate$;_ 6970 Ocornbr$;_ 6980 Orornbr$;_ 6990 Osnbr1$;_ 7000 Zdateser;_ 7010 Invcnbr$;_ 7020 Invdtser;_ 7030 Otaxamt;_ 7040 Taxpct64;_ 7050 Net;_ 7060 Email1$;_ 7070 Email2$;_ 7080 Email3$;_ 7090 Oemlopa$;_ 7100 Oemlsa$;_ 7110 Oemlfi$;_ 7120 Emailedcustflg$;_ 7130 Emailedrepflg$;_ 7140 Emailedresaleflg$;_ 7150 Emailr$;_ 7160 Emailr2$;_ 7170 Type2$;_ 7180 Type3$;_ 7190 Docnum$ 1st Error Message with EXCP=ERR on WRITE STATEMENT +Ok Write table changed to: 'OrdInfo'. >> Yo u have an error in your SQL syntax; check the manual that corresponds to your My SQL server version 2ND Message without EXCP on WRITE STATEMENT Program WWIBOPA An unhandled Exception (29) has occurred Attempting Write of LUN 20, KEY: Opcode (52) Program Address (00002ab4) Network Error [ OK ] Steven Hagen PDF Systems 212-967-1870