Function AX_AXSLocking() Professional

Query or set the ADS locking scheme.

Syntax
AX_AXSLocking( [<lScheme>] ) --> lLockMode
Parameters
<lScheme>
The optional parameter <lScheme> determines either to set the ADS locking scheme to ADSDBE_PROPRIETARY_LOCKING ( .T. ) or to ADSDBE_COMPATIBLE_LOCKING ( .F. ).
Return

This function returns whether the ADSDBE is set to proprietary locking ( .T. ) or compatible locking ( .F. ).

Description

If this function is called without a parameter, it returns whether the ADSDBE is operating with a proprietary locking scheme ( .T. ) or with a compatible locking scheme ( .F. ).

By passing a logical value to the function call, it is further possible to set a new locking scheme for the ADSDBE. By passing .T. to the function, the ADSDBE is instructed to use a proprietary locking scheme. Passing .F.will result in a usage of the compatible locking scheme.

Examples
#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 

   // Determine the type of the locking scheme. 
   IF AX_AXSLocking() 
      ? "ADSDBE is using the proprietary locking scheme." 
   ELSE 
      ? "ADSDBE is using the compatible locking scheme." 
   ENDIF 

   // Close databases and disconnect from server. 
   DbCloseAll() 
   oSession:disconnect() 
RETURN 
Feedback

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.