How do I turn off File Sharing Locks altogether?

W

Wayne

Increasing MaxLocksPerFile to 2,000,000 didn't work...

I am using Assess 2003 and have a major update to over 1,000,000 records
that has to occur for 45 time for 45 accounting quarters... If I try going
file to file then rename the result, the database bloats and I run out of
room. So I wrote a simple match and update routine in VBA but it keeps
blowing on "Run-time error 3052" File sharing lock exceeded.
 
K

Klatuu

Have you tried from the Access Menu Tools->Options and on the Advanced tab
under default record locking selecting No Locks ?
 
W

Wayne

Well, you sure had me scrambling to see if I had pulled a bonehead error...
But "No Locks" is selected...
 
D

Dirk Goldgar

Wayne said:
Increasing MaxLocksPerFile to 2,000,000 didn't work...

I am using Assess 2003 and have a major update to over 1,000,000
records that has to occur for 45 time for 45 accounting quarters...
If I try going file to file then rename the result, the database
bloats and I run out of room. So I wrote a simple match and update
routine in VBA but it keeps blowing on "Run-time error 3052" File
sharing lock exceeded.

Would you care to post your code? Maybe something will suggest itself.
 
R

RD

Increasing MaxLocksPerFile to 2,000,000 didn't work...

I am using Assess 2003 and have a major update to over 1,000,000 records
that has to occur for 45 time for 45 accounting quarters... If I try going
file to file then rename the result, the database bloats and I run out of
room. So I wrote a simple match and update routine in VBA but it keeps
blowing on "Run-time error 3052" File sharing lock exceeded.

Hi Wayne,

I answered you in the other thread but I'll go ahead and post my solution here,
as well.

I ended up closing and re-opening the recordset to clear the MaxLocksPerFile
cache.

In the error handler:
If Err.Number = 3052 Then 'Trap for MaxLocksPerFile error
Set rs = Nothing 'Close recordset
Resume WorkAround 'Clear error and redirect to re-open recordset
End If

Where "WorkAround" is a label just before you set the recordset. There should
be logic in your code so it either picks up where it stopped or ignores the
records already altered.

HTH,
RD
 
D

david epsom dot com dot au

You may get fewer locks if you use Open Exclusive.
I am altering over 800,000 records and each record
that gets altered generates a file lock and each file
lock takes up 2 bytes.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top