MySQL Forums
Forum List  »  Microsoft Access

Re: Autoincrement fields not recognised as Autonumbers
Posted by: George Loeppky
Date: November 15, 2005 09:15AM

This is the fundamental problem with using Access as the front-end to MySQL. Access has no automated or easy access to "mysql_insert_id" (that's the php version, off the top of my I'm not sure what it would be called in Access) to get the last created auto_increment integer. This is the reason why Access runs into problem and shows #DELETED. Ultimately you will have to come-up with an algorithm to generate unique keys.

Either check your largest integer in your db before updating and increment manually (I haven't actually tried this myself so I'm not sure if it's even possible to do in an efficient manner) or come up with an entirely different way to generate a unique key, like having a 2 field key where one is the date and another the userid or something like that. It's fairly unlikely for one user to be able to add more than one entry per second in most cases.

Basically what Access does is inserts data into the database, and than using the data inserted it queries the data back to insure that it inserted. If it finds multiple entries or descrepencies for what ever reason you end up with #DELETED. This is the only way it can verify that the data actually was inserted.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Autoincrement fields not recognised as Autonumbers
2313
November 15, 2005 09:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.