📄 3901.htm
字号:
<HTML>
<HEAD>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<meta HTTP-EQUIV='Expires' CONTENT=0>
<link rel='stylesheet' href='../../../../news.css'>
<style type='text/css'>
.fst{padding:0px 15px;width:770px;background:#eeeecc;border-left:1px solid #000000;border-right:1px solid #000000}
.fstdiv3 img{border:0px;border-right:8px solid #eeeecc;border-top:6px solid #eeeecc}
</style>
<title>
在VC中用OLE DB读写SQL Server中的BLOB字段
</title>
</HEAD>
<BODY aLink=#990000 bgColor=#ffffff bottomMargin=0 leftMargin=0 rightMargin=0 topMargin=0 marginwidth=0 marginheight=0>
<center>
<TABLE align=center bgColor=#cccc99 border=0 cellPadding=2 cellSpacing=0 width=770>
<TBODY>
<TR>
<TH align=left >
在VC中用OLE DB读写SQL Server中的BLOB字段
</TH>
</TD></TR>
</TBODY></TABLE>
<TABLE align=center bgColor=#eeeecc border=1 cellPadding=1 cellSpacing=0 width=770>
<TBODY>
<TR><TD colSpan=5 >
<a href='http://www.csdn.net'>中国软件开发网络</a>
-->
<a href='http://www.csdn.net/develop'>开发图书馆</a>
-->
<a href='http://www.csdn.net\develop\list_article.asp?lib=1&bigclassid=
1
'>
Visual C++
</a>
-->
<a href='http://www.csdn.net\develop\list_article.asp?lib=1&bigclassid=
1
&smallclassid=
107
'>
数据库操作
</a>
-->
<a href='
http://www.csdn.net/develop/library/vc/datebase/3901.shtm
'>
在VC中用OLE DB读写SQL Server中的BLOB字段
</a>
</TD></tr>
<TR>
<TD align=left width=300>
<B>关键字:</B><BR>
在VC中用OLE DB读写SQL Server中的BLOB字段
</TD>
<TD align=middle width=120>
<B>贴文时间</B><br>
2001-2-4 18:00:29
</TD>
<TD align=middle width=80>
<B>文章类型: </B><BR>
原作
</TD>
<TD align=middle width=100>
<B>给贴子投票 </B>
<BR><a href='http://www.csdn.net/develop/addscore.asp?id=
3901
'>投票</a>
</TD></TR>
<TR>
<TD >
fwdever
原作
</TD>
<TD colSpan=3 vAlign=top>
<B>出处: </B><A href='
'>
</A></TD></TR>
<TR><TD colSpan=5 bgcolor=#cccc99> </TD></TR>
</TD></TR></TBODY></TABLE>
<div align=center><div class=fst align=left><div class=fstdiv3 id=print2>
<br><br> <SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本人曾遇到一个非常棘手的问题,在</SPAN><SPAN lang=EN-US>VC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中用</SPAN><SPAN lang=EN-US>OLE DB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">读写</SPAN><SPAN lang=EN-US>SQL Server</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的</SPAN><SPAN lang=EN-US>BLOB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">字段时,尝试了几乎所有的绑定方法,读是没有问题,但总无法成功地将数据写入</SPAN><SPAN lang=EN-US>BLOB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的字段中。后来在</SPAN><SPAN lang=EN-US>SQL Server</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Books OnLines</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中找到一些提示,经多次实验,终于成功地解决问题。在这里提供源代码供大家参考。</SPAN>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">首先,应当从</SPAN><SPAN lang=EN-US>ISequentialStream</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">派生一个类,其头文件如下(</SPAN><SPAN lang=EN-US>SeqStream.h</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">):</SPAN></P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -