Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Runtime 3211 cant lock table.......HELP


Message #1 by "Tim Maher" <tim.maher@s...> on Thu, 29 Aug 2002 11:28:47 +0100
Hi,

Im almost ready to smash in my PC unless someone can help me!!!

Ive got some VBA which runs a make table query in a loop.  The table
that this query produces is then run in a Crosstab Query.

Each crosstab is then exported to excel.


Code Section:

Private Sub RunQueries()
     
     'RUN QUERIES TO MAKE TABLES
    
      DoCmd.OpenQuery "DMake_emergencies", , acReadOnly
      DoCmd.Close acQuery, "DMake_emergencies"

      DoCmd.OpenQuery "D_Crosstab", , acReadOnly
      DoCmd.Close acQuery, "D_Crosstab"
            
End Sub

This runs once and on the second loop the program breaks at the
beginning of the Sub routine with the following error "Run Timee 3211. 
The database engine could not lock table "tbl" because is it already in
use by another person or process"

If anyone can help me I would be very grateful.........

Many thanks

Tim
This e-mail transmission is strictly confidential and intended solely 
for the person or organisation to who it is addressed.  It may contain 
privileged and confidential information and if you are not the 
intended recipient, you must not copy, distribute or take any action 
in reliance on it.  
If you have received this email in error, please notify us as soon as 
possible and delete it.
This e-mail has been scanned using Anti-Virus software, however, 
Swansea NHS Trust accept no responsibility for infection caused by 
any virus received on the recipients system.



Message #2 by "Haslett, Andrew" <andrew.haslett@i...> on Thu, 29 Aug 2002 20:25:24 +0930
You may need to pause execution of the code while access finished making the
table, as it seems it's still in use in your second loop.

I think the command is DOEVENTS or something similar??  Someone may be able
to help us out with that one..

Cheers,
Andrew

-----Original Message-----
From: Tim Maher [mailto:tim.maher@s...]
Sent: Thursday, 29 August 2002 7:59 PM
To: Access
Subject: [access] Runtime 3211 cant lock table.......HELP


Hi,

Im almost ready to smash in my PC unless someone can help me!!!

Ive got some VBA which runs a make table query in a loop.  The table
that this query produces is then run in a Crosstab Query.

Each crosstab is then exported to excel.


Code Section:

Private Sub RunQueries()
     
     'RUN QUERIES TO MAKE TABLES
    
      DoCmd.OpenQuery "DMake_emergencies", , acReadOnly
      DoCmd.Close acQuery, "DMake_emergencies"

      DoCmd.OpenQuery "D_Crosstab", , acReadOnly
      DoCmd.Close acQuery, "D_Crosstab"
            
End Sub

This runs once and on the second loop the program breaks at the
beginning of the Sub routine with the following error "Run Timee 3211. 
The database engine could not lock table "tbl" because is it already in
use by another person or process"

If anyone can help me I would be very grateful.........

Many thanks

Tim
This e-mail transmission is strictly confidential and intended solely 
for the person or organisation to who it is addressed.  It may contain 
privileged and confidential information and if you are not the 
intended recipient, you must not copy, distribute or take any action 
in reliance on it.  
If you have received this email in error, please notify us as soon as 
possible and delete it.
This e-mail has been scanned using Anti-Virus software, however, 
Swansea NHS Trust accept no responsibility for infection caused by 
any virus received on the recipients system.




Message #3 by "Tim Maher" <tim.maher@s...> on Thu, 29 Aug 2002 13:03:56 +0100
Hi Andrew,

Thanks for taking the time to reply.  I have tried placing  DoEvents at
the top of the sub routine before the queries run but to no avail.

Im stumped.

Thanks again


>>> andrew.haslett@i... 08/29/02 11:55am >>>
You may need to pause execution of the code while access finished
making the
table, as it seems it's still in use in your second loop.

I think the command is DOEVENTS or something similar??  Someone may be
able
to help us out with that one..

Cheers,
Andrew

-----Original Message-----
From: Tim Maher [mailto:tim.maher@s...] 
Sent: Thursday, 29 August 2002 7:59 PM
To: Access
Subject: [access] Runtime 3211 cant lock table.......HELP


Hi,

Im almost ready to smash in my PC unless someone can help me!!!

Ive got some VBA which runs a make table query in a loop.  The table
that this query produces is then run in a Crosstab Query.

Each crosstab is then exported to excel.


Code Section:

Private Sub RunQueries()
     
     'RUN QUERIES TO MAKE TABLES
    
      DoCmd.OpenQuery "DMake_emergencies", , acReadOnly
      DoCmd.Close acQuery, "DMake_emergencies"

      DoCmd.OpenQuery "D_Crosstab", , acReadOnly
      DoCmd.Close acQuery, "D_Crosstab"
            
End Sub

This runs once and on the second loop the program breaks at the
beginning of the Sub routine with the following error "Run Timee 3211.

The database engine could not lock table "tbl" because is it already
in
use by another person or process"

If anyone can help me I would be very grateful.........

Many thanks

Tim
This e-mail transmission is strictly confidential and intended solely 
for the person or organisation to who it is addressed.  It may contain

privileged and confidential information and if you are not the 
intended recipient, you must not copy, distribute or take any action 
in reliance on it.  
If you have received this email in error, please notify us as soon as 
possible and delete it.
This e-mail has been scanned using Anti-Virus software, however, 
Swansea NHS Trust accept no responsibility for infection caused by 
any virus received on the recipients system.





This e-mail transmission is strictly confidential and intended solely 
for the person or organisation to who it is addressed.  It may contain 
privileged and confidential information and if you are not the 
intended recipient, you must not copy, distribute or take any action 
in reliance on it.  
If you have received this email in error, please notify us as soon as 
possible and delete it.
This e-mail has been scanned using Anti-Virus software, however, 
Swansea NHS Trust accept no responsibility for infection caused by 
any virus received on the recipients system.




  Return to Index