You are spot on with your answer and that is how I 'solved' the problem. If I was building the system from the ground up then it wouldn't have been so annoying.
It's just that I have built the system using mysql and had written the code on the assumption that if you insert something then the query returns the id which auto-increment generates. I can't make a generic ODBC function to do inserts which returns the value of that which is inserted because it's a different table each time.
So I just select the max(id), but it did mean altering ten scripts or so. The idea of my database abstraction layer was to avoid that sort of thing 🙁
Oh well, next time I develop I'll use ODBC because then I know I have the most limited set of database functions in the world and won't make the mistake of relying on functions which are not common to all SQL environments.
In any case thanks for your advice 🙂
Greetings,
David.