最近上映的国外片:ASP高手指教

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 23:26:40
<%
Function changechr(str)
changechr = replace(str,chr(13),"<br>")
changechr = replace(changechr," "," ")
changechr = RTrim(changechr)
End Function

Dim lAction,ID,MainTitle,SubHead,Penster,WorkUnit,Content,table
Dim Teach_StudySQL
lAction=Request.QueryString("action")
ID=Request.QueryString("id")

MainTitle=Request.Form("MainTitle")
Penster=Request.Form("Penster")
WorkUnit=Request.Form("WorkUnit")
Content=changechr(Request.Form("Content"))
table=request(table)

if lAction="add" then
Teach_StudySQL="Insert Into "&table&" (newsname,newszz,newsdw,newsbody,AppearDate)Values('"&MainTitle&"','"&Penster&"','"&WorkUnit&"','"&Content&"','"&Date()&"')"
Conn.execute(Teach_StudySQL)
Response.Write("<br><br><center><span class='style2'>教学研究添加成功!</span></center>")
else
if lAction="edit" then
Teach_StudySQL="Update "&table&" Set newsname='"&MainTitle&"',newszz='"&Penster&"',newsdw='"&WorkUnit&"',newsbody='"&Content&"',AppearDate='"&Date()&"' where id="&ID
Conn.execute(Teach_StudySQL)
Response.Write("<br><br><center><span class='style2'>教学研究修改成功!</span></center>")
end if
end if
%>

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
/admin/Teach_StudySave.asp, 第 29 行

两个SQL语句不知道错在那里

Teach_StudySQL="Update "&table&" Set [newsname]='"&MainTitle&"',[newszz=]'"&Penster&"',[newsdw]='"&WorkUnit&"',[newsbody]='"&Content&"',[AppearDate]='"&Date()&"' where id="&ID

试试

代码好象没什么问题

可能是数据类型不匹配

看看数据库以及注意request

Teach_StudySQL的SQL语句没有看出有什么错误,你看看是不是有的类型搞错了。或者看看包含的数据库连接文件有没有问题吧。

你看看数据的类型,如果是日期就用#,字符就用‘

调试的时候把Teach_StudySQL打印出来看看,会更好调试。