type char value returned 1
type date value returned 3
type numeric value returned 7
type logic value returned 2
Code: Select all
STATIC FUNCTION ADO_GETFIELDTYPE( nADOFieldType )
LOCAL nDBFFieldType := 0
DO CASE
CASE nADOFieldType == adEmpty
CASE nADOFieldType == adTinyInt
nDBFFieldType := HB_FT_INTEGER
CASE nADOFieldType == adSmallInt
nDBFFieldType := HB_FT_INTEGER
CASE nADOFieldType == adInteger
nDBFFieldType := HB_FT_INTEGER
CASE nADOFieldType == adBigInt
nDBFFieldType := HB_FT_INTEGER
CASE nADOFieldType == adUnsignedTinyInt
CASE nADOFieldType == adUnsignedSmallInt
CASE nADOFieldType == adUnsignedInt
CASE nADOFieldType == adUnsignedBigInt
CASE nADOFieldType == adSingle
CASE nADOFieldType == adDouble
nDBFFieldType := HB_FT_DOUBLE
CASE nADOFieldType == adCurrency
nDBFFieldType := HB_FT_INTEGER
CASE nADOFieldType == adDecimal
nDBFFieldType := HB_FT_LONG
CASE nADOFieldType == adNumeric
nDBFFieldType := HB_FT_LONG
CASE nADOFieldType == adError
CASE nADOFieldType == adUserDefined
CASE nADOFieldType == adVariant
nDBFFieldType := HB_FT_ANY
CASE nADOFieldType == adIDispatch
CASE nADOFieldType == adIUnknown
CASE nADOFieldType == adGUID
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adDate
#ifdef HB_FT_DATETIME
nDBFFieldType := HB_FT_DATETIME
#else
nDBFFieldType := HB_FT_DATE
#endif
CASE nADOFieldType == adDBDate
#ifdef HB_FT_DATETIME
nDBFFieldType := HB_FT_DATETIME
#else
nDBFFieldType := HB_FT_DATE
#endif
CASE nADOFieldType == adDBTime
CASE nADOFieldType == adDBTimeStamp
nDBFFieldType := HB_FT_TIMESTAMP
CASE nADOFieldType == adFileTime
#ifdef HB_FT_DATETIME
nDBFFieldType := HB_FT_DATETIME
#else
//nDBFFieldType := HB_FT_DATE
#endif
CASE nADOFieldType == adBSTR
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adChar
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adVarChar
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adLongVarChar
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adWChar
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adVarWChar
nDBFFieldType := HB_FT_STRING
CASE nADOFieldType == adBinary
nDBFFieldType := HB_FT_OLE
CASE nADOFieldType == adVarBinary
nDBFFieldType := HB_FT_OLE
CASE nADOFieldType == adLongVarBinary
nDBFFieldType := HB_FT_OLE
CASE nADOFieldType == adChapter
CASE nADOFieldType == adVarNumeric
/* CASE nADOFieldType == adArray */
CASE nADOFieldType == adBoolean
nDBFFieldType := HB_FT_LOGICAL
CASE nADOFieldType == adLongVarWChar
nDBFFieldType := HB_FT_MEMO
CASE nADOFieldType == adPropVariant
nDBFFieldType := HB_FT_MEMO
ENDCASE
RETURN nDBFFieldType