MYOB ODBC Error #7495
Posted in blog on Nov 08. Tags: Access 2007, Errors, MYOB, solution, SQL Server
Unexpected internal c-tree(R) error #7495 (uerr_cod=0)
That’s the error message I was getting one day. Nothing major happened, the update routines just stopped working on day!
I’m importing a bunch of data from the usual tables (CustomLists, Customers, Items, Sales) in to the SQL Server back end for faster processing against the company’s CMS. I do this because of the way MYOB has done it’s ODBC driver, every time you do a query, all the table records are read in to memory and THEN the filters are applied, it’s horrendous. Especially if, like this company, you have upwards of 100,000 sales lines. So anyway, it happily dumps the data into the SQL Server tables (using MS Access 2007 as an intermediary) without issue.
The error occurs when I start to insert new records in to the MYOB file.
I’ve tried using the same connection (Reading from a RW connection). I’ve tried using a two connections (Reading from a RO connection and writing to a RW connection); to no avail.
The solution?
ONLY read from or write to the MYOB file while the connection is open. I have taken this to the extreme and put a switch in at the start of the run; if it’s 4am – write any new sales to the MYOB file; if not – read all the MYOB details and update the CMS accordingly.
The error is gone and the work flow is easy to understand for the staff:
- Each morning new invoices should be in MYOB and;
- During work hours the payment details entered in MYOB will be reflected in the CMS every hour.
Obviously the memory handler for the underlying database couldn’t deal with the large number of rows being returned.
