Win32.client, DAO.DBEngine and exceeding the file sharing count lock

M.-A. Lemburg mal at egenix.com
Wed Jul 2 13:30:02 EDT 2008


On 2008-07-02 16:54, Iain King wrote:
> On Jul 2, 3:29 pm, Tim Golden <m... at timgolden.me.uk> wrote:
>> Iain King wrote:
>>> Hi.  I'm using the win32 module to access an Access database, but I'm
>>> running into the File Sharing lock count as inhttp://support.microsoft.com/kb/815281
>>> The solution I'd like to use is the one where you can temporarily
>>> override the setting using (if we were in VB):
>>> DAO.DBEngine.SetOption dbmaxlocksperfile,15000
>> Really hurried answer:
>>
>> <code>
>> import win32com.client
>>
>> dao = win32com.client.gencache.EnsureDispatch ("DAO.DBEngine.36")
>> dao.SetOption (Option=win32com.client.constants.dbMaxLocksPerFile, Value=15000)
>>
>> </code>
>> TJG
> 
> Thanks.  I found this: http://blogs.msdn.com/michkap/archive/2007/07/13/3849288.aspx
> which outlines some difference between DAO and ADO, including:
> "Capability to set and change Jet options without making registry
> changes (works in DAO through DBEngine.GetOption and
> DBEngine.SetOption, fails in ADO, which has no such analogue)."

You could try to use the Access ODBC driver and access the database
that way via mxODBC. That would be faster as well:

http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/iis/reskit/iischp7.mspx
(scroll down to table 7.1)

Apart from that option and if you are really in need for larger
transactions, I'd suggest that you move to SQL Server for processing
(if you can). Access is not really made for heavy-lifting and big
transactions.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 02 2008)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2008-07-07: EuroPython 2008, Vilnius, Lithuania             4 days to go

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611



More information about the Python-list mailing list