bool CLogBuilderDlg::OpenResultSet( _ConnectionPtr connection, _RecordsetPtr recordset, COleDateTime start_date)
{
_CommandPtr objCmd = NULL;
objCmd.CreateInstance(__uuidof(Command));
_variant_t date;
date = start_date;
date.vt = VT_DATE;
try
{
objCmd->ActiveConnection = connection;
objCmd->CommandText = "get_voted_breakdown_test";
objCmd->CommandType = adCmdStoredProc;
objCmd->Parameters->Append(objCmd->CreateParameter("@start_date", adDate, adParamInput, 8, date));
recordset->CursorLocation = adUseClient;
recordset->Open( (IDispatch *)objCmd, vtMissing, adOpenStatic, adLockReadOnly, adCmdStoredProc );
etc..etc
I get the following error:
Error number 80040e21 [Microsoft] [ODBC SQL server driver] Optional feature not implemented.
the stored procedure is declared as follows:
create procedure get_voted_breakdown_test (@start_date datetime) as
.....
and it works fine if I call it from the query analyser.
Searching the microsoft site I found this comment regarding similar problems with
VB.
When the sample code is run, it gives this error:
Run-time error '2147217887 (80040e21)':
[Microsoft][ODBC SQL Server Driver] Optional feature not Implemented.
This is because SQL Server does not support the adDBDate datatype. To correct this problem, change the datatype of the @theDate parameter to adDBTimeStamp.
So what C++ datatype should I be using?
Thanx