This indicates that the 4th parameter, ValueType, is not correct. But I'm
hard coding it to a known valid value. Actually, I'm copying code strait
from the Microsoft Help and still getting this error.
Specifically, here's the lines of code:
DATE_STRUCT dsOpenDate;
SQLINTEGER cbOpenDate = 0;
SQLBindParameter (hstmt, 3, SQL_PARAM_INPUT, SQL_C_TYPE_DATE, SQL_TYPE_DATE,
0, 0, &dsOpenDate, 0, &cbOpenDate);
NOTE: This is from the sample in MS Help page:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2005OCT.1033/odbc/htm/odbcsqlbindparameter.htm
So, according to the error, SQL_C_TYPE_DATE is not valid.
Looking into this further, SQL_C_TYPE_DATE is an ODBC 3.0 define. So,
thecking versions as such:
TRACE ("ODBCVER = %x\n", ODBCVER);
// makes "ODBCVER = 3.51" appear in the trace window.
TCHAR szResult[30];
SWORD nResult;
::SQLGetInfo (m_hdbc, SQL_ODBC_VER, szResult, sizeof(szResult), &nResult);
TRACE ("SQL_ODBC_VER = %s\n", szResult);
// makes SQL_ODBC_VER = 03.52 appear in the trace window.
So, I'm using a 3.0+ driver, I'm compiling with 3.0+ options. Do I need to
set some other option before it will work?
Any help would be appreciated,
Scott
Try
SQL_C_TYPE_TIMESTAMP
- Arnie