Preset access for Standard table types
For DBF and DB tables, security is session-based. The Session object has a login( ) method for DBF table security and a addPassword( ) method for DB table security. The appropriate method (or both if you’re using both types of encrypted tables) must be called with the correct user name and password before attempting to activate a query that accesses the table.
Where this must occur depends on whether all users are sharing the same session. If everyone accessing dBASE Plus gets exactly the same access for every application by using the same user name and password, then they can share the default session. You would need only call the session’s methods once through an administrative program or form.
All the forms would thus require a Query object to access the DBF or DB tables, but no Database object or Session object, because everyone uses the default database in the default session.
On the other hand, if any two applications use different user names or passwords, then every form must have its own Session object, so that each form runs in its own session and the security is localized.
No Database object is needed because the form uses the default database of its own session. Then users must log into each session before the query is activated.
Use the Query object’s canOpen event to call the session’s security methods.