insert的问题,急

flyer79 2003-11-27 01:03:35
代码如下:
<!--#include file="conn.asp"-->
<%
myjpg= request.form("radiobutton")
name=session("name")
msg=rtrim(request("msg"))
myjpg="bbs/pic/"&myjpg

d=date
year1=year(d)
month1=Month(d)
if month1<10 then
month1="0"&month1
end if
day1=Day(d)
if day1<10 then
day1="0"&day1
end if
usertime=year1&month1&day1



myinto = "insert into BBS (jpg,msg,people,time) values ('"& myjpg &"','"& msg &"','"& name &"','"& usertime &"')"
'CONN.EXECUTE myinto
response.Write(myinto)

oldSQL="select talknum from user where name='"& name &"'"
Set oldrs=Conn.Execute(oldSQL)
if not oldrs.eof then
mytalk=oldrs.fields("talknum")
mytalk=mytalk+1
upSQL="update user set talknum='"& mytalk &"' where name='"& name &"'" '存新闻
CONN.EXECUTE(upSQL)


else
response.Write("姓名丢失,请重新登陆")
end if

oldrs.close
Set oldrs = Nothing
conn.close
set conn=nothing
response.redirect"../bbs.asp"



这是个BBS的入库程序,用的是ACCESS的数据库,问题很奇怪:

Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。

/newauto/bbs/talking.asp,行23


把INSERT INTO 语句注销后UPDATA可以正常用,但把同样的INSERT INTO 语句放到SQLSEVER里运行是正常的!我郁闷了两天了,麻烦同志们看看,给个办法!
...全文
45 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
甘泉123 2003-11-28
  • 打赏
  • 举报
回复
那还不结帐???
Tal 2003-11-27
  • 打赏
  • 举报
回复
myinto = "insert into BBS ( jpg,msg,people,[time] ) values ( '" & myjpg & "','" & msg & "','" & name & "','" & usertime & "' )"
'试试
flyer79 2003-11-27
  • 打赏
  • 举报
回复
呵呵呵,郁闷之中上厕所,突然明白,是TIME的问题,TIME是ACCDSS的保留字,换了个名字就好了,谢谢大家!
甘泉123 2003-11-27
  • 打赏
  • 举报
回复
time类型吧~?
skyboy0720 2003-11-27
  • 打赏
  • 举报
回复
我想是在usertime上!
lovehwq21 2003-11-27
  • 打赏
  • 举报
回复
myinto = "insert into BBS (jpg,msg,people,time) values ('"& myjpg &"','"& msg &"','"& name &"','"& usertime &"')"
这四个字段都是字符或时间类型吗?把这句的SQL语句打出来看看,还有检查一下数据库字段

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧