Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Changing MaxLocksPerFile Registy Setting in C#.NET

Changing MaxLocksPerFile Registy Setting in C#.NET

Scheduled Pinned Locked Moved C#
helpcsharpdatabasewindows-adminannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    beatle11
    wrote on last edited by
    #1

    I've looked at some sample code and used the MSDN Library but its not really helping me. I'd like to be able to have code change the MaxLocksPerFile setting in the registry located Under HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 4.0. I can manually change this value but i would like to change it in the code. This needs to be increased because Microsoft Access has problems handling large amounts of data. I have an access database that has hundreds of thousands of records in it and when a user wants to update data in the database there is an error stating "File sharing lock count exceeded. Increase MaxLocksPerFile registry entry." Increasing the value significantly does fix the problem but it would be nice to change this value automatically with code when the user wants to update the database instead of having to go change the registry manually. Any help would be greatly appreciated.

    H C 2 Replies Last reply
    0
    • B beatle11

      I've looked at some sample code and used the MSDN Library but its not really helping me. I'd like to be able to have code change the MaxLocksPerFile setting in the registry located Under HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 4.0. I can manually change this value but i would like to change it in the code. This needs to be increased because Microsoft Access has problems handling large amounts of data. I have an access database that has hundreds of thousands of records in it and when a user wants to update data in the database there is an error stating "File sharing lock count exceeded. Increase MaxLocksPerFile registry entry." Increasing the value significantly does fix the problem but it would be nice to change this value automatically with code when the user wants to update the database instead of having to go change the registry manually. Any help would be greatly appreciated.

      H Offline
      H Offline
      HakunaMatada
      wrote on last edited by
      #2

      Simple. Use the Registry classes in the Microsoft.Win32 namespace. :) Or you can refer to this[^]! Hope this helps! :) --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!

      1 Reply Last reply
      0
      • B beatle11

        I've looked at some sample code and used the MSDN Library but its not really helping me. I'd like to be able to have code change the MaxLocksPerFile setting in the registry located Under HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 4.0. I can manually change this value but i would like to change it in the code. This needs to be increased because Microsoft Access has problems handling large amounts of data. I have an access database that has hundreds of thousands of records in it and when a user wants to update data in the database there is an error stating "File sharing lock count exceeded. Increase MaxLocksPerFile registry entry." Increasing the value significantly does fix the problem but it would be nice to change this value automatically with code when the user wants to update the database instead of having to go change the registry manually. Any help would be greatly appreciated.

        C Offline
        C Offline
        CengBrothers
        wrote on last edited by
        #3

        I have same problem. Can you help me? acdb.ExecuteSQL($@"ALTER TABLE {tableName} ADD COLUMN ROW_NUMBER AUTOINCREMENT");

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups