Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-2008, 05:42 PM
quickemr_groups@yahoo.com
 
Posts: n/a
File sharing lock count exceeded. Increase MaxLocksPerFile registry

Hi all,

I am opening a database and simpy trying to alter the size of a text
column. The database I am testing with has about 160,000 records in
it. This code has worked successfully on other databases, but with
less records.

I open it like this:
Set cnData = New adodb.Connection
cnData.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
DataDBLocation & ";Jet OLEDB:Database"

And alter the table like this:
cnData.Execute "alter table MeasurementsT alter column Measurement2
char(250)"

When working with the 160,000 record table, I get the error message:
File sharing lock count exceeded. Increase MaxLocksPerFile registry

Now, I can certainly edit my own registry and increase this value, but
it would be very difficult and time consuming for me to do this on all
of my clients' computers across the country.

Is there some setting in my code that I can set so that they do not
get this error?

I'm using an Access 2002 database by the way.

Thanks in advance,

David


Reply With Quote
  #2 (permalink)  
Old 08-11-2008, 06:38 PM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFile registry

You can change the current session's setting in vba code without permanently
changing the registry setting.

DBEngine.SetOption dbMaxLocksPerFile, 200000

If 200000 isn't enough, try 300000 or even higher. Set it back to the normal
9500 when you're done with that table operation so you get good performance
with any other queries.

Chris
Microsoft MVP


quickemr_groups@yahoo.com wrote:
>Hi all,
>
>I am opening a database and simpy trying to alter the size of a text
>column. The database I am testing with has about 160,000 records in
>it. This code has worked successfully on other databases, but with
>less records.
>
>I open it like this:
>Set cnData = New adodb.Connection
>cnData.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
>DataDBLocation & ";Jet OLEDB:Database"
>
>And alter the table like this:
>cnData.Execute "alter table MeasurementsT alter column Measurement2
>char(250)"
>
>When working with the 160,000 record table, I get the error message:
>File sharing lock count exceeded. Increase MaxLocksPerFile registry
>
>Now, I can certainly edit my own registry and increase this value, but
>it would be very difficult and time consuming for me to do this on all
>of my clients' computers across the country.
>
>Is there some setting in my code that I can set so that they do not
>get this error?
>
>I'm using an Access 2002 database by the way.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1

Reply With Quote
  #3 (permalink)  
Old 08-11-2008, 07:13 PM
quickemr_groups@yahoo.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

Using VB6, tried the suggestion starting at 50,000 then tried
100,000 , 200,000 , and finally 1,000,000. Still get the error.

-David
Reply With Quote
  #4 (permalink)  
Old 08-11-2008, 08:05 PM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

Back up the db because you're going to make some changes. Your next choice
is to rename the original table to something else, then copy the table
structure as a new table with the original table's name but make the
Measurement2 column 250 chars. Append the records from the original table
into the new table. Copy all relationships from the original table to the
new table and delete the original table (and its relationships if you have
track name autocorrect turned on).

Chris
Microsoft MVP


quickemr_groups@yahoo.com wrote:
>Using VB6, tried the suggestion starting at 50,000 then tried
>100,000 , 200,000 , and finally 1,000,000. Still get the error.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1

Reply With Quote
  #5 (permalink)  
Old 08-11-2008, 08:10 PM
quickemr_groups@yahoo.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

Is there an easy way to do that programmatically? I can't do that one
each of my clients databases. It would take me weeks!
Reply With Quote
  #6 (permalink)  
Old 08-11-2008, 08:37 PM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

You're paying the penalty for making a structural data mistake at the
beginning and fixing it long after the game already started. Why should that
be easy to fix? Haven't you heard of the software development life cycle?
Bugs fixed early in the life cycle are simpler, quicker and cheaper to fix
than bugs found later in the life cycle.

It's not going to take you weeks to fix one column in one table for every
customer, it's just going to seem that long.

Chris
Microsoft MVP


quickemr_groups@yahoo.com wrote:
>Is there an easy way to do that programmatically? I can't do that one
>each of my clients databases. It would take me weeks!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1

Reply With Quote
  #7 (permalink)  
Old 08-11-2008, 09:39 PM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

It won't take you that long, really. Try to code it and if you need help,
post a new question in the modules vba dao group.

I'd suggest building a quick utility db app to back up the customer's db,
import the empty table with the right structure into it (transferdatabase
method), append the records from the original table, add the relationships,
then delete the original table and relationships.

Chris
Microsoft MVP


quickemr_groups@yahoo.com wrote:
>Is there an easy way to do that programmatically? I can't do that one
>each of my clients databases. It would take me weeks!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1

Reply With Quote
  #8 (permalink)  
Old 08-11-2008, 09:51 PM
quickemr_groups@yahoo.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

Thanks for the help Chris. I was just hoping there was some setting I
could use in my code that would prevent that error from happening. I
read about the "DBEngine.SetOption dbMaxLocksPerFile" and was hoping
there was another alternative since it didn't seem to be working for
me.

-David
Reply With Quote
  #9 (permalink)  
Old 08-11-2008, 10:02 PM
Chris O'C via AccessMonster.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

You can try bumping it up to 2000000 but I honestly don't think that will
help. You have so many records in that table that the transaction is filling
up the 2GB temp db file before it can complete the column change.

Chris
Microsoft MVP


quickemr_groups@yahoo.com wrote:
>Thanks for the help Chris. I was just hoping there was some setting I
>could use in my code that would prevent that error from happening. I
>read about the "DBEngine.SetOption dbMaxLocksPerFile" and was hoping
>there was another alternative since it didn't seem to be working for
>me.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1

Reply With Quote
  #10 (permalink)  
Old 08-12-2008, 11:06 PM
quickemr_groups@yahoo.com
 
Posts: n/a
Re: File sharing lock count exceeded. Increase MaxLocksPerFileregistry

If I manally edit the registry key and change it to 50,000, it works!
The setting from VB6 does not seem to do the trick, however.
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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



All times are GMT. The time now is 04:49 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Personal Loans | Mortgage | Buy Playstation 3 | Shopping and Product Reviews | Remortgages



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114