Venice
Project::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
CreateProject
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 project, which positions the file by a key that is unknown
pProject->Browse (VARIANT_FALSE);
// Swap the key to 'PJH_CAT' (10), positioning by category
pProject->SwapKey (10);
// Navigate through the file using the key 'PJH_CAT'
while (pProject->GetDBStatus () == 0)
{
    // Process record data
    
    pProject->GetNext ();
}

C#
 
// Browse for a project, which positions the file by a key that is unknown
oProject.Browse (false);
// Swap the key to 'PJH_CAT' (10), positioning by category
oProject.SwapKey (10);
// Navigate through the file using the key 'PJH_CAT'
while (oProject.GetDBStatus () == 0)
{
    // Process record data
    
    oProject.GetNext ();
}

VBS
 
' Browse for a project, which positions the file by a key that is unknown
Call oProject.Browse(False)
' Swap the key to 'PJH_CAT' (10), positioning by category
Call oProject.SwapKey(10)
' Navigate through the file using the key 'PJH_CAT'
While oProject.GetDBStatus() = 0
    ' Process record data
    
    Call oProject.GetNext()
Wend

VB.NET
 
' Browse for a project, which positions the file by a key that is unknown
oProject.Browse(False)
' Swap the key to 'PJH_CAT' (10), positioning by category
oProject.SwapKey(10)
' Navigate through the file using the key 'PJH_CAT'
While oProject.GetDBStatus() = 0
    ' Process record data
    
    oProject.GetNext()
End While