Type difference for Date in ODBC 2.0 and ODBC 3.0

Abstract: Type difference for Date in ODBC 2.0 and ODBC 3.0

Problem: The type returned for Date is "11" when it should be "93" using the 3.0 ODBC driver. Solution: ODBC 3.0: Date is translated as SQL_TYPE_TIMESTAMP="93". ODBC 2.0: Date is translated as SQL_TIMESTAMP="11". By default, any ODBC connection made to the InterSolv ODBC driver will use ODBC 2.0 calls if it doesn't specify in the connection to behave like a 3.0 driver. If one would like ODBC function calls to return ODBC 3.0 return values, the ODBC function SQLSetEnvAttr can be used to set the driver to return ODBC 3.0 result values. This function call will need to be used before connecting. JDBC (per sun) also uses ODBC 2.0 calls. So the Date type returned for InterBase from JDBC --> ODBC will also be "11". You can use the ODBC function call SQLSetEnvAttr here also to get the return value "93" for the Date type.