用ado存取大对象的看过来
主要代码如下
try{
m_pRecordset->AddNew();
m_pRecordset->PutCollect("AtomNum",long(pDoc->mol.NumofPoints));
//不能用int
m_pRecordset->PutCollect("BondNum",long(pDoc->mol.NumofBonds));
m_pRecordset->PutCollect("SOTI",long(pDoc->mol.m_SOTI));
char *pBuf=new char(size);
if(pBuf!=NULL)
{
copy(s.begin(),s.end(),pBuf);
char *buf=pBuf;
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = size;
psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
for (long i = 0; i < (long)size; i++)
SafeArrayPutElement (psa, &i, pBuf++);
varBLOB.vt = VT_ARRAY | VT_UI1;
varBLOB.parray = psa;
m_pRecordset->GetFields()->GetItem("Info")->AppendChunk(varBLOB);
//delete buf;
}
m_pRecordset->Update();
m_pRecordset->Close();
m_pRecordset = NULL;
}