如题.
  使用ado对Text的字段赋值时候,
   CStr str="从文本取出的字符串";
  _RecordsetPtr pRst;
  pRst.CreateInstance(__uuidof(Recordset));
  pRst->Open((_variant_t)sql,_variant_t((IDispatch*)  theApp.m_pConn,true),adOpenStatic,adLockOptimistic,adCmdText);
  pRst->PutCollect("Content",_variant_t(str));//当文本长度很大的时候,提示 stack flow错误.  请问该怎么存入和取出?谢谢  
  
  

解决方案 »

  1.   

    text 是不限长度的域,这你都弄超了?
    text   
      服务器代码页中的可变长度非   Unicode   数据的最大长度为   231-1   (2,147,483,647)   个字符。当服务器代码页使用双字节字符时,存储量仍是   2,147,483,647   字节。存储大小可能小于   2,147,483,647   字节(取决于字符串)
      

  2.   

    是啊,但是存入的时候,需要转化为变体类型的,在转化的时候提示的错误_variant_t(str));
      

  3.   

    比如写COleVariant var(sContent); 就会出错,提示stack flow 可能是溢出了