Trying to search using evalutate and @dblookup

Hi,

I'm trying to do a lookup in the domino directory to grab the internetAddress field. I'm new at developing in notes, but this is what a friend suggested.

Dim result1 as variant

Dim result2 as variant

Dim value1 as string

Dim value2 as string

result1 = Evaluate(“@Name([Abbreviate]; @UserName)”)

value1 = result1(0)

result2 = Evaluate({@DBLookup(“” : “” ; ServerName : names.nsf ; ($Users) ; value1 ; 17)})

value2 = result2(0)

My DBlookup doesn’t return anything, so it dies when it tries to assign a value to value2. Any help would be appreciated.

Thanks

Subject: Trying to search using evalutate and @dblookup

You need to give it a value for ServerName and anything else not hard-coded into the formula. And you need to escape the quotes. In ths example the fieldname is hard coded, the rest are passed in as variables:

dim e as variant, server as string, database as string, view as string, key as string

server = “Fred”

database = “rubble\rocks.nsf”

view=“Pinups”

key = “Betty”

e = Evaluate(“@DbLookup( ““Notes”” : ““cache”” ; “””+server+“”" : “”“+database+”“” ; “”“+view+”“” ; “”“+key+”“” ; ““fieldName”” )")

Subject: Try…

result1 = Evaluate(“@Name([Abbreviate]; @UserName)”)value1 = result1(0)

result2 = Evaluate({@DBLookup(“” : “” ; “CN=ServerName/O=Org” : “names.nsf” ; “($Users)”; “} + value1 + {”; 17)})

value2 = result2(0)

Subject: RE: Try…

Cool it worked

Thanks