dbwillconvert

Determines whether a specific datatype conversion is available within DB-Library.

Syntax

BOOL dbwillconvert (
INT
srctype,
INT
desttype );

where

srctype
Is the datatype of the data to be converted. This parameter can be any of the SQL Server datatypes.
desttype
Is the datatype that the source data is to be converted into. This parameter can be any of the SQL Server datatypes.

Returns

TRUE if the datatype conversion is supported; FALSE otherwise.

Remarks

When dbconvert is asked to perform a conversion that it doesn't support, it calls a user-supplied error handler (if any) and returns -1.

The dbconvert function can convert data stored in any of the SQL Server datatypes (not all conversions are allowable):

SQL Server datatype Program variable type
SQLCHAR DBCHAR
SQLTEXT DBCHAR
SQLBINARY DBBINARY
SQLIMAGE DBBINARY
SQLINT1 DBTINYINT
SQLINT2 DBSMALLINT
SQLINT4 DBINT
SQLFLT8 DBFLT8
SQLBIT DBBIT
SQLMONEY DBMONEY
SQLDATETIME DBDATETIME
SQLDATETIM4 DBDATETIM4
SQLMONEY4 DBMONEY4
SQLFLT4 DBFLT4
SQLDECIMAL DBDECIMAL
SQLNUMERIC DBNUMERIC

For more information on datatype conversions, see dbconvert.

See Also

dbaltbind, dbbind, dbconvert; DB-Library Options