set conn=server.createObject("ADODB.Connection")
dbpath=server.mappath("../mdba/news.asp")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
set rs=server.createobject("adodb.recordset")
conn.execute insert into news(classfication,title,accessory,imagesname,key1,key2,reporter,lookfrom,newsdate,content)values("a","b","c","j","d","e","f","g",h,"i")
1.用conn.Executeinsert into news classfication,title,accessory,imagesname,key1,key2,reporter,lookfrom,newsdate,content)
values('"&a&"','"&b"'&,'"&c&"','"&j&"','"&d&"','"&e&"','"&f&"','"&g&"',"&h&",'"&i&"')时,"&a&"','"&b"'&,'"&c&"','"&j&"','"&d&"','"&e&"','"&f&"','"&g&"',"&h&",'"&i&"')全成了注释,可能是前面有一个"'"的原因.
然后我改用第二种方法:
strsql="insert into news(classfication,title,accessory,imagesname,key1,key2,reporter,lookfrom,newsdate,content)values('"&a&"','"&b"'&,'"&c&"','"&j&"','"&d&"','"&e&"','"&f&"','"&g&"',"&h&",'"&i&"')"
Set rs=conn.Execute(strSql)
结果还是一样,说语法未完.