Venice
ProjectDet::SwapKey
 
Swaps the file to another key.
 
VARIANT_BOOL SwapKey (
    SHORT sKeyNum
)
 
Parameters
sKeyNum
[in] The number of the key by which you want the file positioned.
 
Return value
True if the file was positioned according to the given key, otherwise false (e.g. if the current record is a null value for the given key or if an invalid sKeyNum was supplied).
 
See Also
CreateProjectDet
SeekBySysNum
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Seek the project detail with system number 17
if (pProjectDet->SeekBySysNum (smEqual, 17))
{
    // Swap the key to 'PJD_PRJ' (1), positioning by project
    pProjectDet->SwapKey (1);
    // Navigate through the file using the key 'PJD_PRJ'
    while (pProjectDet->GetDBStatus () == 0)
    {
        // Process record data
        
        pProjectDet->GetNext ();
    }
}

C#
 
// Seek the project detail with system number 17
if (oProjectDet.SeekBySysNum (eSeekMode.smEqual, 17))
{
    // Swap the key to 'PJD_PRJ' (1), positioning by project
    oProjectDet.SwapKey (1);
    // Navigate through the file using the key 'PJD_PRJ'
    while (oProjectDet.GetDBStatus () == 0)
    {
        // Process record data
        
        oProjectDet.GetNext ();
    }
}

VBS
 
' Seek the project detail with system number 17
If oProjectDet.SeekBySysNum(smEqual, 17) Then
    ' Swap the key to 'PJD_PRJ' (1), positioning by project
    Call oProjectDet.SwapKey(1)
    ' Navigate through the file using the key 'PJD_PRJ'
    While oProjectDet.GetDBStatus() = 0
        ' Process record data
        
        Call oProjectDet.GetNext()
    Wend
End If

VB.NET
 
' Seek the project detail with system number 17
If oProjectDet.SeekBySysNum(eSeekMode.smEqual, 17) Then
    ' Swap the key to 'PJD_PRJ' (1), positioning by project
    oProjectDet.SwapKey(1)
    ' Navigate through the file using the key 'PJD_PRJ'
    While oProjectDet.GetDBStatus() = 0
        ' Process record data
        
        oProjectDet.GetNext()
    End While
End If