日期:2014-05-17  浏览次数:20928 次

急 :ASP插入access数据问题???????
<!--   #include   file= "conn.asp "   -->
<!--   #include   file= "upload_5xsoft.inc "   -->
<%
set   upload=new   upload_5xsoft
pname=upload.form( "pname ")
info=upload.form( "info ")
adddate=date()
set   file=upload.file( "pic ")
file.saveas   server.MapPath( "../ ")& "/datapic/ "&file.filename
picpath= "../datapath/ "&file.filename
ff= "kao "
set   file=nothing

'response.Write(pname& " <br> "&info&adddate&picpath)

conn.execute( "insert   into   product   (pname,pic,date,info)values( ' "&pname& " ', ' "&picpath& " ', ' "&ff& " ', ' "&info& " ') ")
conn.close

response.Write( " <script   language= 'javascript '> alert( '添加成功! ');history.back() </script> ")

%>


conn.execute后面的SQL语句在一行,这里显示换行了
可以从数据库中读数据
所有要插入数据库的参数都能得到
多次尝试也没找到问题的所在

高人指点     谢谢

技术信息(用于支持人员)

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


浏览器类型:
Mozilla/4.0   (compatible;   MSIE   6.0;   Windows   NT   5.1;   SV1;   .NET   CLR   2.0.50727)  

网页:
POST   12979   ???   /gps/admin/prd_add.asp

POST   Data:
错误   '80020009 '  
发生意外。  

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


------解决方案--------------------
conn.execute( "insert into product ([pname],[pic],[date],[info])values( ' "&pname& " ', ' "&picpath& " ', ' "&ff& " ', ' "&info& " ') ")
------解决方案--------------------
date和ff是日期类型的话:
conn.execute "insert into product(pname,pic,[date],info) values( ' " & pname & " ', ' " & picpath & " ',# " & ff & "#, ' " & info & " ') "
------解决方案--------------------
date为access关键字