你好呀。在我的表单上进行测试提交后,我在此语句中收到语法错误:
“Microsoft JET 数据库引擎错误‘80040e14’
查询表达式 'c_name='Golden Wattle' AND sc_name='Acacia pycnantha' AND url=' http://anpsa.org.au/a-pyc.html ' AND image= ' http://anpsa.org.au/a-pyc.html 中的语法错误(缺少运算符) http:// /anpsa.org.au/jpg/029_2.jpg ' AND price='$72' AND information='Golden Wattle 是澳大利亚的国花。''。
/courses/benv/2410/2013s2/3420384/exercises/ex05/insert-plant.asp,第 54 行
对于我的一生,我无法理解这里出了什么问题。
dim cn, sc, url, image, price, desc
cn=Request.Form("new_cn")
sc=Request.Form("new_sc")
url=Request.Form("new_url")
image=Request.Form("new_image")
price=Request.Form("new_price")
desc=Request.Form("new_desc")
'--- check to see whether there already are items of that name...
SQL="select ID from PlantTable where c_name='"& cn & "' AND sc_name='" & sc & "'"&_
" AND url='"&url& "' AND image='"&image& "' AND price='"&price& "' AND information='"&desc& "' "
set info = conn.execute(SQL)
if info.eof then
'--- there is no plant of that name at present, so do the insert
SQL="insert into PlantTable (c_name, sc_name, url, image, price, information) values ('" & cn & "', "&sn&","&url&","&image&","&price&","&desc&")"
conn.execute(SQL)
response.write "Insertion completed."
else
'--- there is already a plant of that name...
response.write "Sorry, that Plant Name is already in the database."
end if