Function AX_RightsCheck() Professional
Query or set the security method used to open or create files.
AX_RightsCheck( [<lNewSetting>] ) --> lOldSetting
This function returns whether or not the ADSDBE is using the connected user's access rights.
If this function is called without a parameter, it returns whether the ADSDBE is using the connected user's access rights ( .T. ) or not ( .F. ).
By passing a logical value to the function call, it is possible to enable or disable the usage of connected user's access rights. Passing .T., the usage will be enabled, passing .F. forces ADS Server to ignore the connected user's rights and use its own access rights instead to perform File I/O operations on the file server.
Please note that changing this setting only affects newly opened workareas. Therefore it is possible to determine the method of security on a per-workarea basis.
#include "ads.ch"
// Install ADSDBE as default database engine.
PROCEDURE DbeSys
IF !DbeLoad( "ADSDBE" )
Alert( "ADSDBE could not be installed!" )
ENDIF
DbeSetDefault( "ADSDBE" )
RETURN
PROCEDURE Main
// Connect to database server.
LOCAL cConnect := "DBE=ADSDBE;SERVER=\\ALASKA\VOL1"
LOCAL oSession := DacSession():new( cConnect )
IF .NOT. oSession:isConnected()
Alert( "Connection to server could not be established!" )
QUIT
ENDIF
AX_RightsCheck( .F. ) // Use access rights of ADS Server
USE TEST1 NEW
AX_RightsCheck( .T. ) // Use access rights of connected user
USE TEST2 NEW
/*
* Operations...
*/
// Close databases and disconnect from server.
DbCloseAll()
oSession:disconnect()
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.