<div>大家好,</div>
<div>有谁用过Win32::ODBC插入一个'ntext'field的吗?SQL Server 2005的环境,我在插入时总是回报错。</div>
<div>在DB的表里看,这是一个不可见的字符,我用ODBC查询得到的是'\x00\x00\x00\x01',可用insert插入这样的字符到DB里就会报错'[Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark after the character string ''.'</div>
<div> </div>
<div>谁能给一些指点呢。非常感谢!</div>
<p>here is my script:<br>----------------------<br>use Win32::ODBC;<br>use Encode;</p>
<p>$DSN = "DSN=automation;UID=sa;PWD=********";<br>$conn = new Win32::ODBC($DSN);</p>
<p>$a = "\x00\x00\x00\x01";</p>
<p>$sql = "insert into dcc_AgentCommand (CmdType, AgentType, CmdCreateTime, CmdContentMD5, CmdCreateOwner, CmdContent) values(64, 256, '03/16/2008 10:00:00 AM', 'NoMD5', 2, '$b')";</p>
<p>#insert a record!!<br>$conn->Sql($sql);</p>
<p>----------------------</p>
<p>here is my perl version<br>C:\Documents and Settings\Uliyas>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's history</p>
<p>HISTORY<br>Last Modified 1999.09.25.<br></p>