急、在线等解决问题、、、、、

lishunhu253 2004-05-13 12:55:04
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("dfff.mdb")
name_t=request.Form("name")
phone_t=request.Form("phone")
if name_t ="" or phone_t="" then

else
KeMu_t=request.Form("KeMu")
sex_t=request.Form("sex")
month_t=request.Form("month1")+request.Form("month2")
xueli_t=request.Form("xueli")
sfzhm_t=request.Form("sfzhm")
txdz_t=request.Form("txdz")
mail_address_t=request.Form("mail_address")
email_t=request.Form("email")
textarea_t=request.Form("textarea")
sj=date()
exec="insert into dftt values('"&KeMu_t&"','"&name_t&"','"&sex_t&"','"&month_t&"','"&xueli_t&"','"&sfzhm_t&"','"&txdz_t&"','"&mail_address_t&"',"&email_t&",'"&textarea_t&"','"&sj&"')"
conn.execute exec
end if
conn.close
set conn=nothing
sj=date()
response.write "您的信息已经提交成功!"
%>
出错信息:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
...全文
30 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lishunhu253 2004-05-13
  • 打赏
  • 举报
回复
好的,我试试!
sinusoid 2004-05-13
  • 打赏
  • 举报
回复
insert into 表名(字段1、字段2、字段3...) values(值1、值2、值3...)
要列出具体的字段来
feiyuekongjian 2004-05-13
  • 打赏
  • 举报
回复
这样写较容易出错,不如这样:
set rs=server.createobject("adodb.recordset")
str="select * from dftt where 1=2"
rs.open str,conn,1,3
rs.addnew
rs("KeMu_t")=KeMu_t
.
.
.
.
.
每个字段都写到。最后加一句
rs.update
response.write "您的信息已成功提交"

以上要注意字段类型要与插入的数据类型一致。

lawdoor 2004-05-13
  • 打赏
  • 举报
回复
分布尝试一下操作:
1.response.write exec
response.end
2.conn.execute (exec)
sunboby 2004-05-13
  • 打赏
  • 举报
回复
up
fashchina 2004-05-13
  • 打赏
  • 举报
回复
UP

28,390

社区成员

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

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