NotesDatabase搜索条件

use*_*368 1 lotus-notes lotusscript

使用此代码:

Set col = db.Search("Form=""formname"" & id=212", time, 0)
Run Code Online (Sandbox Code Playgroud)

我明确地给出了搜索功能212,但是如果我想给出一个变量该怎么办

dim var as Integer
Run Code Online (Sandbox Code Playgroud)

我的搜索结果如何,因为这不起作用:

Set col = db.Search("Form=""formname"" & id=var", time, 0)
Run Code Online (Sandbox Code Playgroud)

Knu*_*ann 5

Set col = db.Search("Form=""formname"" & id=" + Cstr(val), time, 0)
Run Code Online (Sandbox Code Playgroud)

应该管用.

Cstr()将整数值转换为字符串.