hi mark the sql is identical, the way its handled in the call for the class is *slightly* different but the problem wasnt there which is why i was getting so confused by it, i thought it was originally but after getting rid of everything bar what was left in the example in my post and still having the problem, just kinda flummoxed me. the sql doesnt fail (it inserts a record) it just wasnt picking up the last insert id and returning it, guffa's solution to split the queries into two works fine, but i still dont see what would cause it or why it would fail after getting to 65535 as theres nothing that defines a smallint or restricts it to that. v odd me thinks thanks tim