I usually just create different database files and share them with a Dropbox link, having two different files with two different random keys. I'm using version 2.09.
I have a "personal.kdbx" database that has all my personal stuff and a "company-name.kdbx". I usually use the "key file" option to open the databases since it's easier to the people I share with to copy it to an old USB drive and say "this drive is needed to open the passwords in the file, DO NOT lose this flash drive".
I don't know if this approach is a good one to your scenario, I think you're looking for some kind of "groups permissions" in a single *.kdbx file. I don't think this is possible. I haven't seen this option on the KeePass website or in the documentation.
4Security note: When passing the password of another DB to to be opened by KeePass it is much better practice to encrypt the password before passing it in plaintext to cmd.exe. You can do this by replacing
-pw:{PASSWORD}
with-pw-enc:{PASSWORD_ENC}
See http://keepass.info/help/base/placeholders.html#passwordenc – adam – 2015-10-27T18:48:29.5531@Kiquenet: I'm not exactly sure what you're after. Having a bat file open KeePass without entering the password, completely destroys security of the setup. Perhaps you should ask a specific question about it? – Johny Skovdal – 2016-10-13T17:26:52.630
How-to *encrypt the password* to passing in plaintext to cmd, bat script;( script calls Keepass.exe) ? – Kiquenet – 2016-10-13T17:40:33.777
Again, what do you (@Kiquenet) mean by calling KeePass? Please make a complete question out of it instead. :) – Johny Skovdal – 2016-10-13T18:24:28.227