> 
> I am using ActivePerl 5.8 and DBD::ODBC, ODBC is connecting 
> to Microsoft Access Driver.
> 
> At the end of my Perl program, I want to DROP all tables just 
> created for tempory use. However, it caused error. The error 
> message is about " the table xxx is being used by other 
> applications .... " ( I just translate the chinese error 
> message to English now, so the meaning is just roughly...). I 
> am sure I didn't use that table(s) at the same time.
> 
> How can I solve the problem?

Which version of DBD::ODBC are you using?

You might still have some statements open that have tables in use.  I
regularly, especially during the install tests, create and drop tables.

Make sure that you've looped through all the data.  A safe way would/could
be (high level)

my $dbh = DBI->connect();

# put all your work in the worker function.
# this will ensure that your statement handles are closed
call_worker_func($dbh);

eval {
        $dbh->do("drop table test");
}
$dbh->disconnect;


Sub call_worker_func($) {
        my $dbh = shift;
        do work here
}

As an alternative, you can disconnect, then reconnect to drop the tables.
That would force the issue.

Jeff


Reply via email to