问个SQL语句的问题

来源:百度知道 编辑:UC知道 时间:2024/09/27 07:19:52
我有一组数据,一共50条,数据库里也有50条数据,我想通过以下的语句,用现有的50条记录替换数据库里的50条记录,但是总是调试不成功。
i=0
for i to 50 begin
sql=" update product set namese='"&names&"', pic='"&pic&"'where id="&i
i=i+1
end
conn.execute(sql)

rs.movenext
wend

end if
response.write "导入成功"
end if

结果是:错误类型:
Microsoft VBScript 编译器错误 (0x800A03F3)
缺少 '='
/test/1/admin/index.asp, line 67, column 6
for i to 50 begin
-----^

首先这id是不是numeric类型。其次where前面加个空格
sql=" update product set namese='"&names&"', pic='"&pic&"' where id="&i

你在试试看

去掉begin end

把update前面是空格去掉……