|
<< Click to Display Table of Contents >> DbiOpenFieldXlt |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiOpenFieldXlt (pszSrcDriverType, pszSrcLangDrv, pfldSrc, pszDesDriverType, pszDstLangDrv, pfldDest, pbDataLoss, phXlt);
Delphi syntax
function DbiOpenFieldXlt (pszSrcTblType: PChar; pszSrcLangDrv: PChar; pfldSrc: pFLDDesc; pszDestTblType : PChar; pszDstLangDrv: PChar; pfldDest: pFLDDesc; var bDataLoss: Bool; var hXlt: hDBIXlt): DBIResult stdcall;
Description
DbiOpenFieldXlt builds a field translation object that can be used to translate a logical or physical field type into any other compatible logical or physical field type.
Parameters
pszSrcDriverType Type: pCHAR (Input)
Pointer to the source driver type. Set to NULL for logical.
pszSrcLangDrv Type: pCHAR (Input)
Pointer to the language driver name of the source. Set to NULL if no character set transliteration is desired. Ignored if both source and destination are not character types.
pfldSrc Type: pFLDDesc (Input)
Pointer to the source field descriptor.
pszDesDriverType Type: pCHAR (Input)
Pointer to the destination driver type. Set to NULL for logical.
pszDstLangDrv Type: pCHAR (Input)
Pointer to the language driver name of the destination. Set to NULL if no character set transliteration is desired. Ignored if both source and destination are not character types.
pfldDest Type: pFLDDesc (Input)
Pointer to the destination field descriptor.
pbDataLoss Type: pBOOL (Output)
Pointer to a client variable used to indicate both the possibility of data loss and actual data loss for each field translated when DbiTranslateField is called. If NULL, no data loss detection is done.
phXlt Type: phDBIXlt (Output)
Pointer to the translation object handle.
Usage
This function used in conjunction with DbiTranslateField allows clients to convert any logical or physical field data to any compatible logical or physical field data. The client supplies a pair of logical or physical field descriptors. These descriptors can be obtained from a call to DbiGetFieldDescs or DbiOpenFieldList.
If pbDataLoss is supplied, this client indicator variable is set to TRUE when the translation object is built if there is the potential for data loss when converting between the source and destination field types. For example, if the user requests a translation object to convert a dBASE character field to a BDE logical TIMESTAMP field, the data loss indicator is set to TRUE, because the character field may not contain a legal TIMESTAMP string according to the current session's DBIDATE and TIME conventions. Additionally, each time DbiTranslateField is called this client flag is set to TRUE if that particular field conversion caused data loss. If supplied, this client variable must remain addressable until the translation object is closed with DbiCloseFieldXlt. For BLOB fields, this function provides a translation object that does nothing.
DbiResult |
Meaning |
DBIERR_NONE |
The translation object was successfully built. |
DBIERR_NOTSUPPORTED |
The requested field conversion is not considered legal. |
DBIERR_INVALIDPARAM |
One of the required pointers is NULL. |
DBIERR_INVALID_FIELDDESC |
One of the field descriptors is invalid. |
DBIERR_NO_MEMORY |
More space is needed in pbDataLoss. |
See also