Function AX_IDType() Professional

Determine if the current record is encrypted.

Syntax
AX_IDType() --> nType
Return

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

Return values of AX_IDType()
Return Description
ADS_NO_RECORD No current record
ADS_STANDARD_RECORD Standard record
ADS_ENCRYPTED_RECORD Encrypted record

Description

This function detects if the current record 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 nCount, nType 

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

   // Open TEST.DBF, set a password for this workarea and 
   // encrypt the table. 
   USE Test NEW EXCLUSIVE 
   AX_SetPass( "Hobbit" ) 

   IF AX_DBFEncrypt() 
      ? "Encryption ok." 
   ELSE 
      ? "Encryption FAILED!" 
   ENDIF 

   // Now clear the password value. 
   AX_SetPass("") 

   // Append some more records. 
   FOR nCount := 1 to 10 
      DbAppend() 
      Test->REMARK := "Simply a test." 
   NEXT 

   // Now go to the top of the database and check all records 
   // for their status. 
   DbGoTop() 
   DO WHILE !eof() 
      ? RecNo() 

      nType := AX_IDType() 
      DO CASE 
         CASE nType == ADS_NO_RECORD 
            ?? ": No record!" 
         CASE nType == ADS_STANDARD_RECORD 
            ?? ": Not encrypted." 
         CASE nType == ADS_ENCRYPTED_RECORD 
            ?? ": Encrypted." 
      ENDCASE 

      DbSkip() 
   ENDDO 

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