C Examples: DbiTranslateField

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiTranslateField

Return to chapter overview

Translate a field from IDAPI Logical format to its physical format equivalent or vice versa.

DBIResult fDbiTranslateField(hDBICur hCur, hDBIXlt hXlt, pBYTE pTransField)

{

   DBIResult      rslt;

   pBYTE          pFieldBuf;

   pBYTE          pRecBuf;

   CURProps       CurProps;

   Chk(DbiGetCursorProps(hCur, &CurProps));

   pRecBuf = (pBYTE)malloc(CurProps.iRecBufSize);

   pFieldBuf = (pBYTE)malloc(1024);

   pTransField = (pBYTE)malloc(1024);

   Chk(DbiSetToBegin(hCur));

   Chk(DbiGetNextRecord(hCur, dbiNOLOCK, pRecBuf, NULL));

   Chk(DbiGetField(hCur, 1, pRecBuf, pFieldBuf, NULL));

   rslt = Chk(DbiTranslateField(hXlt, pFieldBuf, pTransField));

   return rslt;

}