in reply to INSERT into SQL 2000
I might be going blind here but it appears that you are using a new lexical $dbh in your insert_record() subroutine. I am surprised it doesn't croak with an error though.
/J\