Is there a way using macro, to determine if macros are enabled?

By using macro, is there a way to determine if the LO macro settings are enabled, or at least determine the current folder is a “trusted location”?
I made a Base, connected to a MySQL database, however, if the users can access the tables, they can see what they are not supposed to see. I know I can filter the the tables, but it is impractical in my situation. To solve this, I learned from this forum on how to hide the Base app window. However, they can still access the tables if they open the Base with “Disable Macros”. I know adding “trusted location” is a solution to this. But what if the user manages to copy and paste the .odb file to a different location and still access the tables.

So I was thinking of creating a dummy .odt (as a launcher) file to check if the macro settings is enabled and the trusted source is still there. and runs the odb file from there.

Or is there a better way? Thanks.


Don’t you use passwords for users? And if you want to limit what they see assign each appropriate access rights - limited visibility. All done through database. See your DB documentation.

If you have access within the macros (not a good direction), have you password protected the libraries?

The only way is to set this rights well in the database. And only allow connection to users, which are defined there with a separate password.

The database file from LO won’t have any possibility to get more security for a database as it is allowed by the database. You could set filter for tables, set the main window of Base not visible - but all this could be returned to normal behavior by any user, who will start the database file.

To your first question: No, you can’t check by macro. Acually you may check, but the check is only executed if macros are enabeled.
So your test can be shortened:

    If true then
        MsgBox("cogito ergo sum")

And as I can always disable macros in settings I can always read anything not encrypted…

So use macros for convenience, not for security.