<div>大家好,</div>
<div>有谁用过Win32::ODBC插入一个'ntext'field的吗?SQL Server 2005的环境,我在插入时总是回报错。</div>
<div>在DB的表里看,这是一个不可见的字符,我用ODBC查询得到的是&#39;\x00\x00\x00\x01&#39;,可用insert插入这样的字符到DB里就会报错&#39;[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark after the character string &#39;&#39;.&#39;</div>
<div>&nbsp;</div>
<div>谁能给一些指点呢。非常感谢!</div>
<p>here is my script:<br>----------------------<br>use Win32::ODBC;<br>use Encode;</p>
<p>$DSN = &quot;DSN=automation;UID=sa;PWD=********&quot;;<br>$conn = new Win32::ODBC($DSN);</p>
<p>$a = &quot;\x00\x00\x00\x01&quot;;</p>
<p>$sql = &quot;insert into dcc_AgentCommand (CmdType, AgentType, CmdCreateTime, CmdContentMD5, CmdCreateOwner, CmdContent) values(64, 256, &#39;03/16/2008 10:00:00 AM&#39;, &#39;NoMD5&#39;, 2, &#39;$b&#39;)&quot;;</p>
<p>#insert a record!!<br>$conn-&gt;Sql($sql);</p>
<p>----------------------</p>
<p>here is my perl version<br>C:\Documents and Settings\Uliyas&gt;perl -v</p>
<p>This is perl, v5.8.8 built for MSWin32-x86-multi-thread<br>(with 33 registered patches, see perl -V for more detail)</p>
<p>Copyright 1987-2006, Larry Wall</p>
<p>Binary build 819 [267479] provided by ActiveState <a href="http://www.activestate.com/">http://www.ActiveState.com</a><br>Built Aug 29 2006 12:42:41</p>
<p>Win32::ODBC&#39;s history</p>
<p>HISTORY<br>Last Modified 1999.09.25.<br></p>