[Microsoft][ODBC SQL Server Driver][SQL Server]在关键字 ✀and✀ 附近有语法错误

2025-04-08 17:24:52
推荐回答(4个)
回答1:

set qq=db.execute("select * from loans where uid="&request("uid")&" and bid="&request("bid")&"")


db.execute("update loans set loan_='1' where uid="&request("uid")&" and bid="&request("bid")&"")

最后两个双引号间少了个单引号

改为

db.execute("update loans set loan_='1' where uid="&request("uid")&" and bid="&request("bid")&"'")

那把1两边的单引号去掉

不然去掉
db.execute("update loans set loan_='1' where uid="&request("uid")&" and bid="&request("bid")&"")

中的&""

把AND前边的空格去掉

去掉&""也不行么 ?

db.execute "update loans set loan_=1 where uid='"&request("uid")&"' and bid='"&request("bid")&"'"

前边的那个也改,这样呢?

回答2:

双引号之间的直接叠加!!

回答3:

select * from loans where uid=" & val(request("uid")) & " and bid=" & val(request("bid")) &"
注意:在 & 号的前后必须有空格!

回答4:

最好的方法就是把你的那句sql语句输出,看看那里有问题。然后再根据问题更改.