我的MSSQL2000表中有一个content字段,类型为ntext
我想插入文本数据,可怎么也插入不了,简单的数据可以插入,以下是我的一个表单提交的一个文本数据:<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
border:none;
mso-border-bottom-alt:solid windowtext .75pt;
padding:0cm;
mso-padding-alt:0cm 0cm 1.0pt 0cm;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;
mso-footnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fs;
mso-footnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fcs;
mso-endnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") es;
mso-endnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-even-header:url("eWebEditor_Temp_Word_Doc.files/header.html") eh1;
mso-header:url("eWebEditor_Temp_Word_Doc.files/header.html") h1;
mso-even-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ef1;
mso-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") f1;
mso-first-header:url("eWebEditor_Temp_Word_Doc.files/header.html") fh1;
mso-first-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ff1;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</STYLE><STYLE>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</STYLE><DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal><SPAN lang=EN-US>a</SPAN></P></DIV>求各位帮忙,我该咋办?
我想插入文本数据,可怎么也插入不了,简单的数据可以插入,以下是我的一个表单提交的一个文本数据:<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
border:none;
mso-border-bottom-alt:solid windowtext .75pt;
padding:0cm;
mso-padding-alt:0cm 0cm 1.0pt 0cm;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;
mso-footnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fs;
mso-footnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fcs;
mso-endnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") es;
mso-endnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-even-header:url("eWebEditor_Temp_Word_Doc.files/header.html") eh1;
mso-header:url("eWebEditor_Temp_Word_Doc.files/header.html") h1;
mso-even-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ef1;
mso-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") f1;
mso-first-header:url("eWebEditor_Temp_Word_Doc.files/header.html") fh1;
mso-first-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ff1;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</STYLE><STYLE>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</STYLE><DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal><SPAN lang=EN-US>a</SPAN></P></DIV>求各位帮忙,我该咋办?
但上面数据为什么不行,我该咋办?
set @s='<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
border:none;
mso-border-bottom-alt:solid windowtext .75pt;
padding:0cm;
mso-padding-alt:0cm 0cm 1.0pt 0cm;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;
mso-footnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fs;
mso-footnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fcs;
mso-endnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") es;
mso-endnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-even-header:url("eWebEditor_Temp_Word_Doc.files/header.html") eh1;
mso-header:url("eWebEditor_Temp_Word_Doc.files/header.html") h1;
mso-even-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ef1;
mso-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") f1;
mso-first-header:url("eWebEditor_Temp_Word_Doc.files/header.html") fh1;
mso-first-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ff1;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</STYLE><STYLE>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</STYLE><DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal><SPAN lang=EN-US>a</SPAN></P></DIV>
'
update tb set content=@s
CREATE TABLE #t(VALUE nTEXT)INSERT INTO #t
VALUES('
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
border:none;
mso-border-bottom-alt:solid windowtext .75pt;
padding:0cm;
mso-padding-alt:0cm 0cm 1.0pt 0cm;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;
mso-footnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fs;
mso-footnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fcs;
mso-endnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") es;
mso-endnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-even-header:url("eWebEditor_Temp_Word_Doc.files/header.html") eh1;
mso-header:url("eWebEditor_Temp_Word_Doc.files/header.html") h1;
mso-even-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ef1;
mso-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") f1;
mso-first-header:url("eWebEditor_Temp_Word_Doc.files/header.html") fh1;
mso-first-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ff1;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</STYLE><STYLE>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</STYLE><DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal><SPAN lang=EN-US>a</SPAN></P></DIV>')
我的ASP主要代码如下: Content = ""
For I = 1 To Request.Form("Content").Count
Content = Content & Request.Form("Content")(I)
Next
...连接MSSQL2000数据库略...
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from Article where ArticleID = 0"
rs.open sql,conn,1,3
rs.addnew
rs("Content") = Content
rs.close
Set rs = Nothing我该咋办?
<form method="POST" name="myform" onSubmit="return checkForm()" action="Save.asp">
<INPUT type="hidden" name="Content" value="">
<IFRAME ID="eWebEditor1" src="/ewebeditor/ewebeditor.htm?id=Content&style=standard600&skin=officexp&originalfilename=d_originalfilename&savefilename=d_savefilename&savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="600" height="350"></IFRAME>
<input type="submit" name="Add" id="Add" value=" 添 加 " style="cursor:hand;">
</form>
表单提交后,Content的内容已经被提交过来了,这儿我已经确认无误(使用Response.write)
Save.asp的主要代码
Content = ""
For I = 1 To Request.Form("Content").Count
Content = Content & Request.Form("Content")(I)
Next
Response.write Content '显示完全正确,但写入到数据表里就不行了
...连接MSSQL2000数据库略...
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from Article where ArticleID = 0"
rs.open sql,conn,1,3
rs.addnew
rs("Content") = Content
rs.close
Set rs = Nothing
use tempdb
gocreate table t(id int identity(1,1),content ntext)insert into t (content)
select '
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
border:none;
mso-border-bottom-alt:solid windowtext .75pt;
padding:0cm;
mso-padding-alt:0cm 0cm 1.0pt 0cm;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:none;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;
mso-footnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fs;
mso-footnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") fcs;
mso-endnote-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") es;
mso-endnote-continuation-separator:url("eWebEditor_Temp_Word_Doc.files/header.html") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-even-header:url("eWebEditor_Temp_Word_Doc.files/header.html") eh1;
mso-header:url("eWebEditor_Temp_Word_Doc.files/header.html") h1;
mso-even-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ef1;
mso-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") f1;
mso-first-header:url("eWebEditor_Temp_Word_Doc.files/header.html") fh1;
mso-first-footer:url("eWebEditor_Temp_Word_Doc.files/header.html") ff1;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</STYLE><STYLE>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</STYLE><DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal><SPAN lang=EN-US>a</SPAN></P></DIV>
'/*(1 行受影响)*/select * from t/*id content
----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 (1 行受影响)
*/
Content = ""
For I = 1 To Request.Form("Content").Count
Content = Content & Request.Form("Content")(I)
Next
Response.write Content '显示完全正确,但写入到数据表里就不行了
...连接MSSQL2000数据库略...
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from Article where ArticleID = 0"
rs.open sql,conn,1,3
rs.addnew
rs("Content") = Content
rs.update
rs.close
Set rs = Nothing
不好意思上面打掉rs.addnew了,我调试中有这句,我该咋办?
For I = 1 To Request.Form("Content").Count
Content = Content & Request.Form("Content")(I)
Next
...连接MSSQL2000数据库略...
set rs=server.createobject("adodb.recordset")
sql="select top 1 Content from Article where ArticleID = 0"
rs.open sql,conn,1,3
rs.addnew
rs("Content") = Content
rs.close
Set rs = Nothing
但你的rs 是select的。。能这样做吗?对asp不熟。。
后来,无意中看到查询分析器,抱着试试的态度,语句输入执行后,还真有数据在里面
我有些不明白,为什么在控制台里面显示不出来,在查询分析器里就显示出部分出来了
真诚谢谢各位帮忙!