Table locked by exclusive user problem

meboz

Registered User.
Local time
Today, 16:32
Joined
Aug 16, 2004
Messages
71
Hi,

I have a module that imports data from CSV files and then deletes and modifies certain data using a number of action queries.

It works fine but when I attempt to open a query based on one of the tables that has been modified, it tells me that the table is opened exclusively by another user.

The code im using to execute the queries for each query is as follows:

Code:
Set qdf = db.QueryDefs("some_action_query")
          qdf.execute

I have a feeling this is where the problem lies. How can I 'unlock' the tables without leaving the db?

Thanks,

meboz
 
Only Querydefs, or Recordsets too ?

Is that all your code does, or does it open recordsets at all? You might get that problem if you open a recordset and your procedure terminates without closing it.
 
No.

There arent any recordsets opening.

However, I do wrap the executions in a transaction.

If an error occurs before it commits, does this leave the transaction open?

Would that be the problem?

Thanks.
 
I don't know, but that would seem like a reasonable place to start looking.

Would you not want to enable an error handler and have it roll back the transaction if appropriate ?
 

Users who are viewing this thread

Back
Top Bottom