Hi,

how can I use bind variables with oledb for better performance?

for MS and Oracle it's look like this:


CCommand<CDynamicParameterAccessor,CNoRowset,CNoMultipleResults>*m_zw[MAXSTR
ZANZAHL];

CSession m_session;


BOOL WriteData(double *w, int Anzahl, int OrgId, int ZeitId, int Liste)
{
CString s,s1;
HRESULT hr;
int i;
BOOL ret=true;
void *pDummy;

if(!m_zw[Liste])
{
s.Format(_T("UPDATE %s_Z%03d SET "),m_Prefix,Liste);
for(i=0;i<Anzahl;i++)
{
s1.Format(_T("F%03d = ?"),i);
s+=s1;if(i<(Anzahl-1))s+=_T(",");
}
s+=(_T(" WHERE sId=? AND zId=? "));
m_zw[Liste]=new
CCommand<CDynamicParameterAccessor,CNoRowset,CNoMultipleResults>;
if(FAILED(hr=m_zw[Liste]->Create(m_session,s)))
return ret;
if(FAILED(hr=m_zw[Liste]->Prepare()))
return ret;

if(FAILED(hr=m_zw[Liste]->BindParameters(&m_zw[Liste]->m_hParameterAccessor,
m_zw[Liste]->m_spCommand,&pDummy)))
return ret;
}

for(i=0;i<Anzahl;i++)
m_zw[Liste]->SetParam((ULONG)i+1,&w[i]);
m_zw[Liste]->SetParam((ULONG)Anzahl+1,&OrgId);
m_zw[Liste]->SetParam((ULONG)Anzahl+2,&ZeitId);
if(FAILED(hr=m_zw[Liste]->Open(NULL,NULL,0)))
return ret;
return ret;
}


thank you for any help
arno