Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经根据从表单上的单个文本框传递的值成功查询了 Access 中的数据数据,但是有没有办法将逗号分隔的列表传递到 IN 查询中,或者类似的东西?
目标是搜索多个单值标准。
您需要在代码中动态创建 SQL,然后将结果查询提供给行源参数。
如果逗号列表是数字 (1,5,723),那么您可以执行以下操作:
ssql = "select * from table where field IN(" + scommalist + ")"
如果列表是文本,则必须对其进行解析并在每个值周围加上引号。