Hi,

our code looks like:

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

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

CSession *sess=&m_session;
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(*sess,s)))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten Create"));
return ret;
}
if(FAILED(hr=m_zw[Liste]->Prepare()))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten Prepare"));
return ret;
}

if(FAILED(hr=m_zw[Liste]->BindParameters(&m_zw[Liste]->m_hParameterAccessor,
m_zw[Liste]->m_spCommand,&pDummy)))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten BindParameters"));
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)))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten Open"));
return ret;
}

return ret;
}

arno


"Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>

wrote in message news:40fe5acd@forums-1-dub...
> There must be more to this as Ceate, Prepare, BindParameters are not OLEDB
> methods AFAIK. It does not look to be MFCs CDatabase class. What is the
> class/class libraries that you are using?
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>