请高手帮忙看看这一段ASP代码

来源:百度知道 编辑:UC知道 时间:2024/05/17 12:15:26
这个代码是连接到ACCESS数据库的更新代码,做为新闻系统所用,需要更新文章的内容Content表,代码如下:

<!-- #include file="articlechar.inc" -->
<%
hot=request.Form("hot")
if request.Form("tuij")="checkbox" then
tuij=1
else
tuij=0
end if

type_id=request.Form("type_id")
title=htmlencode2(request.Form("title"))
writer=request.Form("writer")
from=request.Form("from")
content=htmlencode2(request.Form("content"))
if request.Form("ttime")="" then
ttime=year(now)&"年"&month(now)&"月"&day(now)&"日"
else
ttime=request.Form("ttime")
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from content",conn,1,3
rs.addnew
rs("type_id")=type_id
rs("title")=title
rs("writer")=writer
rs("fro

如果你的articlechar.inc文件中有conn对象建立语句的话,你的这段代码应该没有问题,有提示没,发出来研究下。

有错误提示没,看你代码好像没什么问题,rs.open "select * from [content]",conn,1,3 加个[]试试

<!-- #include file=\"articlechar.inc\" -->
<%
hot=request.Form(\"hot\")
if request.Form(\"tuij\")=\"checkbox\" then
tuij=1
else
tuij=0
end if

type_id=request.Form(\"type_id\")
title=htmlencode2(request.Form(\"title\"))
writer=request.Form(\"writer\")
from=request.Form(\"from\")
content=htmlencode2(request.Form(\"content\"))
if request.Form(\"ttime\")=\"\" then
ttime=year(now)&\"年\"&month(now)&\"月\"&day(now)&\"日\"
else
ttime=request.Form(\"ttime\")
end i