ASP Classic + SQL server 2000

时间:2011-10-12 06:14:31

标签: asp-classic sql-server-2000

UPDATE a 
SET a.status =  1 
FROM tbl_Assets2010 AS a 
INNER JOIN tbl_Master AS m ON a.AssetNo = m.AssetNo 
WHERE a.AssetNo =" & Request.Form(AssetNo")

错误

  

语法错误将varchar值'1006-101'转换为   数据类型int。

我从文本字段中获取值。我必须使用的是正确的代码。

1 个答案:

答案 0 :(得分:1)

您必须将其作为字符串处理(请注意下面的Request.Form周围的撇号。)

UPDATE a SET a.status = 1 FROM tbl_Assets2010 AS a INNER JOIN tbl_Master AS m ON a.AssetNo = m.AssetNo WHERE a.AssetNo ='" & Request.Form(AssetNo") & "'"