dim strsql as string
dim strIn as string
strIn="1,2,3"
strsql="DELETE Article.ID FROM Article WHERE Article.ID In (" & strIn & ")"
currentproject.connection.execute strsql
DELETE Article.ID
FROM Article
WHERE (((Article.ID) In ([@IDs],[@ids2],[@ids3])));
参数只允许有一个,如果你在[@IDs]里面填写 1,2,3仍然被作为一个参数,而不是3个。
如果你要达到你需要的效果,必须用 VBA 来组织 jet SQL 语句
dim strsql as string
dim strIn as string
strIn="1,2,3"
strsql="select * from table in(" & strIn & ")"
currentproject.connection.execute "create view 查询名称 as " & strsql