dbwillconvert

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

Syntax

BOOL dbwillconvert (
INT
srctype,
INT
desttype );

Arguments
srctype
Is the data type of the data to be converted. This parameter can be any of the Microsoft® SQL Server™ data types.
desttype
Is the data type that the source data is to be converted into. This parameter can be any of the SQL Server data types.
Returns

TRUE if the data type 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 data types (not all conversions are allowable):

SQL Server data type 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 about data type conversions, see dbconvert.

See Also
dbaltbind dbconvert
dbbind DB-Library Options

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.