Tuesday, June 1, 2010

ADS 10 Tip #2 – Rights Checking Behavior

Advantage 10 changes the default behavior for rights checking. The default in version 9 and earlier is to check rights when making connections and opening tables. When using a version 10 client, rights are always ignored regardless of the rights checking setting.

CheckRightsThis leads to better performance since it avoids having the client check if it has rights to a file prior to opening it. Since the Advantage Service is opening the file for the client this check is unnecessary.

The diagram illustrates the steps taken when rights checking is enabled. Step one is the request to the network/domain controller checking for rights to the table. Step two is the response from the server. Step three is the open request to Advantage. Steps one and two are not performed when rights are ignored which can save time especially on multiple file opens.

If you rely on the network to provide security to your tables you can set the Advantage client to respect the check rights setting. This is done with the AdsSetRightsChecking API. Make a call to this API using the ADS_RESPECT_RIGHTS_CHECKING (2) option in your application startup code. This setting is global and will be respected until the ace.dll is unloaded.