我用是SQL2000数据库,有这样一段更新书籍库的代码:
<%name=Replace(Request.Form("name"),"'","''")
content=Replace(Request.Form("content"),"'","''")
email=Replace(Request.Form("email"),"'","''")
if name="" or email="" or content="" then
response.write"<script language='JavaScript'> alert ('昵称、邮箱或回复内容不能为空!');history.go(-1);</script>"
else
set rs1=server.createobject("adodb.recordset")
set rs2=server.createobject("adodb.recordset")
sql1="select max(id) as maxid from note"
ssql2="select * from note"
name=trim(request.form("name"))
email=trim(request.form("email"))
content=trim(request.form("content"))
subject=trim(request.form("subject"))
application.lock
rs1.open sql1,conn,1,3
if rs1.eof or isnull(rs1("maxid")) then
id="00001"
else
temp=left(rs1("maxid"),5)
temp=right(temp,5)
temp=cint(temp)
temp=cstr(temp+1)
for length=1 to 5-len(temp)
temp="0"&temp
next
id=temp
end if
datetime=now()
sql2="insert into note (id,name,subject,email,content,datetime) values('"& id &"','"& name &"','"& subject &"','"& email &"','"& content &"','"& datetime &"');"
rs2.open sql2,conn,1,3
end if
application.unlock
conn.close
set conn=nothing
set rs1=nothing
%>
提交时,提示“错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]从字符串转换为 datetime 数据类型时发生语法错误。”
这是数据库设置截图:
谁能帮我解决这个问题?