设为首页
加入收藏夹

在VC中用OLE DB读写SQL Server中的BLOB
浏览选项:

yle="mso-tab-count: 1">              const ULONG cBytes = 4096;

                BYTE pWriteData[cBytes];  //从这个数组写入BLOB数据

                memset(pWriteData, '', cBytes);

                UINT nRead=0;

 

                nRead=fle.Read(pWriteData,cBytes);

                while (nRead>0)

                {

                        pMySeqStream->Write(pWriteData,nRead,NULL);

                        nRead=fle.Read(pWriteData,cBytes);

                }

                fle.Close();

 

                //一定要执行此句,重设Stream当前位置到它的最开始处

                pMySeqStream->ResetPosition();

 

                BLOBSetData.pISeqStream = (ISequentialStream*)pMySeqStream;

                BLOBSetData.dwStatus    = DBSTATUS_S_OK;

                BLOBSetData.dwLength    = pMySeqStream->Length();

 

                //BLOB数据写入到数据库.

           &nb


[首页]    [上一页]    [下一页]    [末页]    

Copyright © 2004 wanxu.com All Rights Reserved