I'm converting several MS Access (.mdb) files into a single MySql database.
The core of the script is a call to a COTS converter utility that generates
a temporary data base and automatically takes care of table creation and
data insertion.  Then, I (effectively) copy the temporary MySql data base
tables into my objective MySql data base using:

            $sth_insert = $dbh_analysis->prepare("INSERT INTO ARP
                                                      SELECT * FROM
temp.arp") || 
                                   warn "Error preparing INSERT:
$dbh_analysis->errstr";
          $sth_insert->execute() or
              warn "Error updating ARP table : $dbh_analysis->errstr";

after I copy all of the data base tables (the example above is for the ARP
table), I have to drop the temporary data base because the converter utility
doesn't like it if its target data base (temp) already exists when its
called..I drop the 'temp' data base using:

        # Prepare the DROP statement for temp data base
        $sth_drop = $dbh->prepare("DROP DATABASE IF EXISTS temp") or 
                            die "Error preparing temp db DROP:
$dbh_temp->errstr";
      $sth_drop->execute() or
          die "Error executing temp DB DROP statement: $dbh_temp->errstr";

the first time through, I get this:

DBD::mysql::st execute failed: Error dropping database (can't delete
'.\temp\sys
coord.MYI', errno: 4869344) at C:\FBCB2\LUT2A\dbConverter\accToMySql.pl line
261
..
Uncaught exception from user code:
        Error executing temp DB DROP statement:
DBI::db=HASH(0x1a75734)->errstr
at C:\FBCB2\LUT2A\dbConverter\accToMySql.pl line 261.
Database handle destroyed without explicit disconnect at
C:\FBCB2\LUT2A\dbConver
ter\accToMySql.pl line 261.

the syscoord table is one of 11 tables (the 'last') in the temp data base,
all the others are cleanly deleted.  The syscoord.MYD and syscoord.MYI files
are the only thing left in the mysql\data\temp folder...after the crash, I
can manually drop the data base using either the command line or gui
versions of the MySql administration utilities....and, there's nothing in
the mysql.err file to indicate any type of error....

Jason Erickson

Reply via email to