Search in the FAQ under the section "Admin" for a thread called "Prevent Duplicate ID # due to page Reload"
It could be the script is having problems within sub add_record where it checks for the next available key. It currently is setup to give up after 50 times.
Here's the thread reference fix:
Prevent Duplicate ID # due to page Reload
in HTML.PL
Add this to top of your file for reference of changes made:
### prevent NEW ID on reload - added codes in sub html_add_failure
sub html_add_failure {
# --------------------------------------------------------
AFTER:
my ($message) = $_[0]; add:
### prevent dup ID # . . also commented out code in .cgi sub add_record ###
if ($message eq "duplicate key error") {
&html_home;
return;
}
### prevent dup ID numbers ####
In your .CGI: in sub add_record
Add this to top of your file for reference of changes made:
# prevent NEW ID on reload - removed codes in sub add_record
AFTER: # First we validate the record to make sure the addition is ok.
$status = &validate_record;
##### comment out the following to prevent a new ID # being assigned when the form
is reloaded ####
## We keep checking for the next available key, or until we've tried 50 times after which
we give up.
# while ($status eq "duplicate key error" and $db_key_track) {
# return "duplicate key error" if ($counter++ > 50);
# $in{$db_key}++;
# $status = &validate_record;
# }
This is fully tested and works great!
Let us know if that solves your problem.
Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/