[此贴子已经被作者于2007-3-23 14:54:18编辑过]
我的错误是:我做了个留言板,在往数据库里存信息的时候,出现的这种错误,如果我直接往数据库里写信息也能实现出来,可通过页面写就出现这个错误,我检查了代码,没有错误。帮帮我,现在很郁闷。
这是保存流言的代码:name=Replace(Request("txtname"),"'","''")
mail=Replace(Request("txtmail"),"'","'''")
subject=Replace(Request("txtsubject"),"'","''")
img=Request("radimg")
memo=Server.HTMLEncode(Request("txtmemo"))
memo=Replace(memo,vbCrLf,"<br>")
memo=Replace(memo," "," ")
memo=Replace(memo,"'","''")
If name=Empty or subject=Empty or memo=Empty Then
Response.Write"<center>"
Response.Write"<h3> 发言人、主题、内容没有写完整!!</h3>"
Response.Write"<a href=index.asp>回留言窗口</a>"
Response.End
End If
set cnobj=server.createobject("adodb.connection")
dbpath=server.mappath("db.mdb")
cnobj.connectionstring="provider=microsoft.jet.oledb.4.0;data source="&dbpath
cnobj.open
sqlcmd="insert into guest(姓名,信箱,主题,图标,内容)" & "values('" & name & "','" &mail& "','" & subject & "','" & img & "','" & memo & "')"
cnObj.Execute sqlcmd
cnObj.Close
Set cnObj = Nothing
Response.Redirect "showmsg.asp"