How to deny changing of connection properties by end-users?

Last modified:

We've designed the "mixed mode" for this purpose. In this mode, the connection settings are stored in the .ini file in the program installation folder, which is usually in "Program Files", so it's not writable without having the administrator privileges. The rest of the settings like positions of windows, user queries, etc. will be stored inside the user's local AppData folder or in the Registry.

To turn the tool into this mode do the following:

  1. Prepare your database connections in the tool as usual (you can turn on the data read-only mode in the Connection Settings dialog if needed)
  2. Switch the program settings storage location to the Local AppData folder using the main menu - Settings - "Settings storage location..." dialog, save and close the tool.
  3. Find the "FlySpeed SQL Query.ini" file in the "%USERPROFILE%\AppData\Local\ActiveDBSoft\FlySpeed SQL Query" folder and copy it to the program installation folder.
  4. Run the tool again.

After that, when the user changes the connection properties, he will be prompted to elevate his rights to Administrator via UAC.

PS. Note that the user should not be able to copy a program installation folder from Program Files to his user profile and run the tool there. Otherwise, he will do this and be able to change any connection settings. I believe there is a Windows Local Group policy setting that denies doing this. You can google for it or follow the steps described in this article.


Is this article helpful for you?