gpt4 book ai didi

sql - Vb6 缺少运算符

转载 作者:行者123 更新时间:2023-12-02 02:23:55 25 4
gpt4 key购买 nike

在我的学校项目中工作,当我将 ORDER BY 方面添加到我的 sql 时,尽管其余代码运行良好,但遇到了这个缺少运算符的错误。

Set rs_fav = db_kwickfix.OpenRecordset("
SELECT Recipe.Rec_Name
FROM Recipe,Favourites
WHERE (Recipe.RecipeID = Favourites.RecipeID)
AND (Favourites.UserID = " & frm_login.user_id & ")
ORDER BY Recipe.Rec_Name DESCENDING
")

最佳答案

尝试DESC而不是DESCENDING,检查ORDER BY Clause (Transact-SQL)这是:

ORDER BY order_by_expression
[ COLLATE collation_name ]
[ ASC | DESC ]
[ ,...n ]
[ <offset_fetch> ]

因此:

Set rs_fav = db_kwickfix.OpenRecordset("
SELECT Recipe.Rec_Name
FROM Recipe,Favourites
WHERE (Recipe.RecipeID = Favourites.RecipeID)
AND (Favourites.UserID = " & frm_login.user_id & ")
ORDER BY Recipe.Rec_Name DESC
")

关于sql - Vb6 缺少运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41286927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com