Hi,

I am trying to set type mapping for mssql dynamically instead of having to rely on the mssqldrv.ini file to be correct. and getting errors
I am using DF19.1 and SQL Driver version: 6.3.0.15

This is the code I execute after opening a table that is mssql so the driver is loaded and DriverIndex returns a correct index number:
Code:
Procedure SetSQLDataTypeMappings
    Integer iDriver
    Get DriverIndex "MSSQLDRV" to iDriver
    Set_Attribute DF_DRIVER_MAP_DFDATE_TO_SQLTYPE of iDriver to SQL_TYPE_DATE
    Set_Attribute DF_DRIVER_MAP_DFDATETIME_TO_SQLTYPE of iDriver to SQL_TYPE_TIMESTAMP2
    Set_Attribute DF_DRIVER_MAP_DFASCII_TO_SQLTYPE of iDriver to SQL_WCHAR
End_Procedure
I get the follwing error, one for each of the three Set_Attribute lines:

Code:
Bad attribute value, Attempting to set DF_DRIVER_MAP_DFDATE_TO_SQLTYPE to invalid value (91)
Bad attribute value, Attempting to set DF_DRIVER_MAP_DFDATETIME_TO_SQLTYPE to invalid value (-200)
Bad attribute value, Attempting to set DF_DRIVER_MAP_DFASSCII_TO_SQLTYPE to invalid value (-8)
I did get the SQL_TYPE_DATE, SQL_TYPE_TIMESTAMP2 and SQL_WCHAR from the help.
Not sure how to proceed now.

Thank you,
Oscar Mintegui