[CDBI] ODBC last_insert_id Problems

James Hargreaves james.hargreaves at gmail.com
Tue Dec 12 22:50:47 GMT 2006


Hi guys!

I normally use MySQL as my backend database, but for a particularly
cheapskate project (MySQL costs £25 per year on my hosting) I have
been forced to use MS Access accessed via ODBC.

This was fine until I started trying to insert items into the database
using the usual My::Class->insert(...) method. Items are inserted
correctly but I receive an error due to there being no support (so far
as I am aware) for the LAST_INSERT_ID function in MS Access. All this
is probably not helped by my not being able to use the latest version
of Class-DBI since I am running on windows and it doesn't compile
correctly :(

So basically - what can I do? I cannot change the database - I might
be able to access it directly (rather than through ODBC) but I am not
sure if this will help or how to do this? The problem occurs in the
_auto_increment_value method (called in the _insert_row method) and I
can't see any way to fix this function without trashing something
else.

Any help would be appreciated - here's to cheap-skates :)

Regards
Jay

-- 
Bingo, bango, boshthedog.com



More information about the ClassDBI mailing list