Open database exclusively

  • Hi

    Does adModeShareExclusive open the database exclusively for any use/database model, or does that function only concern MS Access databases?

    Thanks

  • Re: Open database exclusively


    I believe it applies to any database opened in MS Access, however if there are already users connected to (for example) an SQL database then it will not give you exclusivity (since they are already connected). However if you use this on an SQL database with no users currently connected to it then it will be opened in single user mode.

  • Re: Open database exclusively


    Quote from Rob Xaos;527943

    However if you use this on an SQL database with no users currently connected to it then it will be opened in single user mode.



    Interesting theory, i'm trying it out on 3 instances of SQL Server and the only way i can get single user mode is by using t-sql.


    Code
    ALTER DATABASE AdventureWorks SET SINGLE_USER
    GO
  • Re: Open database exclusively


    I have now tried this with MS Access database without success.

    The connection is from Excel with ADODB connection defined to be .admodeshareexclusive

    When i open this kind of connection to the database, other users are still able to connecto to it at the same time and read data.

    Any ideas why?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!