Venice
CtLnk::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
CreateCtLnk
Browse
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for a contact-firm link, which positions the file by a key that is unknown
pCtLnk->Browse (VARIANT_FALSE);
// Swap the key to 'CTL_EMA' (4), positioning by e-mail address
pCtLnk->SwapKey (4);
// Navigate through the file using the key 'CTC_EMA'
while (pCtLnk->GetDBStatus () == 0)
{
    // Process record data
    
    pCtLnk->GetNext ();
}

C#
 
// Browse for a contact-firm link, which positions the file by a key that is unknown
oCtLnk.Browse (false);
// Swap the key to 'CTL_EMA' (4), positioning by e-mail address
oCtLnk.SwapKey (4);
// Navigate through the file using the key 'CTC_EMA'
while (oCtLnk.GetDBStatus () == 0)
{
    // Process record data
    
    oCtLnk.GetNext ();
}

VBS
 
' Browse for a contact-firm link, which positions the file by a key that is unknown
Call oCtLnk.Browse(False)
' Swap the key to 'CTL_EMA' (4), positioning by e-mail address
Call oCtLnk.SwapKey(4)
' Navigate through the file using the key 'CTC_EMA'
While oCtLnk.GetDBStatus() = 0
    ' Process record data
    
    Call oCtLnk.GetNext()
Wend

VB.NET
 
' Browse for a contact-firm link, which positions the file by a key that is unknown
oCtLnk.Browse(False)
' Swap the key to 'CTL_EMA' (4), positioning by e-mail address
oCtLnk.SwapKey(4)
' Navigate through the file using the key 'CTC_EMA'
While oCtLnk.GetDBStatus() = 0
    ' Process record data
    
    oCtLnk.GetNext()
End While