PC Review


Reply
Thread Tools Rate Thread

DDL Query And Error 3211

 
 
Doctor
Guest
Posts: n/a
 
      29th Jun 2009
When the queries below run they fail with error 3211: table is locked. I've
double checked recordsets again and again to make sure they are closed and
set to nothing. This is the part that doesn't make sense. When I step
through these queries in debugger mode, they work great. Even if I place my
cursor at Exit Sub and run the code to the cursor from the beginning, they
run fine. But if not in debugger mode, they fail.

Thanks in advance for the help.


strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN State LONG;"
DBEngine(0)(0).Execute strSQL, dbFailOnError
strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN BillState LONG;"
DBEngine(0)(0).Execute strSQL, dbFailOnError
strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN ShipState LONG;"
DBEngine(0)(0).Execute strSQL, dbFailOnError
strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN Country LONG;"
DBEngine(0)(0).Execute strSQL, dbFailOnError
strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN BillCountry LONG;"
DBEngine(0)(0).Execute strSQL, dbFailOnError
strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN ShipCountry LONG;"
DBEngine(0)(0).Execute strSQL, dbFailOnError


-----------------------------------------------------------------------------
Our Peering Groups change
Visit : http://spacesst.com/peerin
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      30th Jun 2009
On Mon, 29 Jun 2009 13:46:01 -0700, Doctor <(E-Mail Removed)>
wrote:

>When the queries below run they fail with error 3211: table is locked. I've
>double checked recordsets again and again to make sure they are closed and
>set to nothing. This is the part that doesn't make sense. When I step
>through these queries in debugger mode, they work great. Even if I place my
>cursor at Exit Sub and run the code to the cursor from the beginning, they
>run fine. But if not in debugger mode, they fail.
>
>Thanks in advance for the help.
>
>
>strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN State LONG;"
>DBEngine(0)(0).Execute strSQL, dbFailOnError
>strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN BillState LONG;"
>DBEngine(0)(0).Execute strSQL, dbFailOnError
>strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN ShipState LONG;"
>DBEngine(0)(0).Execute strSQL, dbFailOnError
>strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN Country LONG;"
>DBEngine(0)(0).Execute strSQL, dbFailOnError
>strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN BillCountry LONG;"
>DBEngine(0)(0).Execute strSQL, dbFailOnError
>strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN ShipCountry LONG;"
>DBEngine(0)(0).Execute strSQL, dbFailOnError


Try putting a line

DoEvents

after each Execute line. It's possible that the first query is still executing
at the time you run the second, and so on.
--

John W. Vinson [MVP]

-----------------------------------------------------------------------------
Less Spam Better enjoyable experience
Visit : news://spacesst.com
 
Reply With Quote
 
Doctor
Guest
Posts: n/a
 
      30th Jun 2009

Yup, that took care of the issue. Thanks so much for the help.

"John W. Vinson" wrote:

> On Mon, 29 Jun 2009 13:46:01 -0700, Doctor <(E-Mail Removed)>
> wrote:
>
> >When the queries below run they fail with error 3211: table is locked. I've
> >double checked recordsets again and again to make sure they are closed and
> >set to nothing. This is the part that doesn't make sense. When I step
> >through these queries in debugger mode, they work great. Even if I place my
> >cursor at Exit Sub and run the code to the cursor from the beginning, they
> >run fine. But if not in debugger mode, they fail.
> >
> >Thanks in advance for the help.
> >
> >
> >strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN State LONG;"
> >DBEngine(0)(0).Execute strSQL, dbFailOnError
> >strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN BillState LONG;"
> >DBEngine(0)(0).Execute strSQL, dbFailOnError
> >strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN ShipState LONG;"
> >DBEngine(0)(0).Execute strSQL, dbFailOnError
> >strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN Country LONG;"
> >DBEngine(0)(0).Execute strSQL, dbFailOnError
> >strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN BillCountry LONG;"
> >DBEngine(0)(0).Execute strSQL, dbFailOnError
> >strSQL = "ALTER TABLE ztblImportChurches ALTER COLUMN ShipCountry LONG;"
> >DBEngine(0)(0).Execute strSQL, dbFailOnError

>
> Try putting a line
>
> DoEvents
>
> after each Execute line. It's possible that the first query is still executing
> at the time you run the second, and so on.
> --
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 3211 =?Utf-8?B?R2xlbm4gU3VnZ3M=?= Microsoft Access Form Coding 2 13th Oct 2007 08:45 PM
Error 3211 - tbl already in use darren via AccessMonster.com Microsoft Access VBA Modules 1 8th Feb 2007 10:03 AM
error 3211 Harmannus Microsoft Access Forms 1 27th Dec 2004 04:05 AM
Error 3211 =?Utf-8?B?RnJhbms=?= Microsoft Access External Data 0 23rd Mar 2004 01:56 PM
Error 3211 Mark Microsoft Access Form Coding 1 30th Dec 2003 06:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:19 AM.