更新时间:2023-11-30 22:58:46
尽管 OLEDB 类可以使用命名参数,但它实际上只是使用了一个?"标记在背景中,因此参数按 INDEX 顺序排列.您的 sql 在 Subsp 变量之前出现了 ID 变量.
Despite the fact that the OLEDB class can use named parameters, it is actually just using a '?' marker in the background, so the parameters are in INDEX order. Your sql has the ID variable occurring before the Subsp variable.
切换它,像这样:
For Each match As Long In choices
command_sbsp.Parameters.Clear()
command_sbsp.Parameters.AddWithValue("@ID", match)
command_sbsp.Parameters.AddWithValue("@Subsp", word)