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

Update 语句错误,请各位帮忙改改吧
错误类型:
Microsoft   VBScript   编译器错误   (0x800A0401)
语句未结束
sql_   =   "update   tabPerson   set   Name=(trim(request( "Name "))),Sex   =   (request( "Sex "))   where   [ID]= ' "(Request( "ID ") " '




------解决方案--------------------
sql_ = "update tabPerson set Name= ' "&name& " ',Sex = ' "&sex& " ' where [ID]= ' "&ID& " ' "
------解决方案--------------------
sql_ = "update tabPerson set Name= ' "&trim(request( "Name "))& " ',Sex = ' "&request( "Sex ")& " ' where [ID]= "&Request( "ID ")

字符型用 ' "&request( " ")& " ' 数值型用 "&request( " ")& "
------解决方案--------------------
楼上正解。

------解决方案--------------------
&&
------解决方案--------------------
id = Request( "id ")
name = trim(Request( "name "))
sex = Request( "sex ")

sql_ = "update tabPerson set Name= ' " & name & " ',Sex = ' " & sex & " ' where [ID]= ' " & id & " '

多写两行不会死人的。