Msado60_Backcompat error in CCommand :: CreateParameter

I am developing an ADO application (32 bit) for Windows 7 with 64-bit Service Pack 1 (all installed updates): the application should run on Win XP. According to http://support.microsoft.com/kb/2517589/en-us I am using msado60_backcompat. This worked well until recently, but now it is crashing.

My code (snippets):

_CommandPtr cmd(__uuidof(Command));
cmd->ActiveConnection = dbconn;
cmd->CommandText = _T("SELECT [si] FROM [TTable] WHERE [TTable].[ti1]=?");
cmd->Parameters->Append(cmd->CreateParameter(L"@ti1", adTinyInt, adParamInput, 1, 7));

CreateParameter is implemented in msado60_backcompat:

inline _ParameterPtr Command15::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, ADO_LONGPTR Size, const _variant_t & Value )
{
  struct _Parameter * _result = 0;
  HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result);
  if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
  return _ParameterPtr(_result, false);
}

raw_CreateParameter () calls in msado15.dll in CCommand :: CreateParameter. There crashes at offset 0x34f (offset within a function):

0x655ed5a6 (msado15.dll) adosqlbugcheck.exe: 0xC0000005: 0xcccccccc.
0x655ed5a6 (msado15.dll) adosqlbugcheck.exe: 0xC0000005: 0xcccccccc.

Msado60_Backcompat.tlb: 73728 , 29.4.2011
msado15.dll: 6.1.7601.17514, 1019904 , 21.11.2010

, msado15.dll.

- ? ?

+5
1

. # msado60_backcompat.tlb "C:\Program Files\Common Files". "C:\Program Files (x86)\Common Files", . tlh tlb UUID , ,

typedef __int64 ADO_LONGPTR; 
typedef ADO_LONGPTR PositionEnum_Param; 

typedef long ADO_LONGPTR; 
typedef enum PositionEnum PositionEnum_Param; 

COM . MS , , , .

MS : http://blogs.msdn.com/b/psssql/archive/2011/10/03/yes-we-made-a-mistake-and-are-finally-going-to-fix-it.aspx.

+7

All Articles