Function AX_TableType() Professional

Determine whether the current database file is encrypted.

Syntax
AX_TableType() --> nType
Return

The return value corresponds to one of the following #define constants:

Return values of AX_TableType()
Return Description
ADS_NO_TABLE No open database file
ADS_STANDARD_TABLE Standard database file
ADS_ENCRYPTED_TABLE Encrypted database file

Description

The function detects if the current database file is encrypted.

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 ) 
   LOCAL nType 

   IF .NOT. oSession:isConnected() 
      Alert( "Connection to server could not be established!" ) 
      QUIT 
   ENDIF 

   // Open TEST.DBF and determine whether it is encrypted. 
   USE Test NEW EXCLUSIVE 

   nType := AX_TableType() 
   DO CASE 
      CASE nType == ADS_NO_TABLE 
         ?? ": No database file in use!" 
      CASE nType == ADS_STANDARD_TABLE 
         ?? ": Not encrypted." 
      CASE nType == ADS_ENCRYPTED_TABLE 
         ?? ": Encrypted." 
   ENDCASE 

   // 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.