Evaluate @DBLookup not working with variables

Hi,

Having problem using variables in a DBLookup via Lotus Script and the Evaluate statement.

If I hard code the Server name, path, and key value - it works great. But if I try to use variables for any of these values then it no longer works.

Saw some postings here saying to use bars with the '&" to get the value of the variable. But this did not work either. I suspect the answer is something like this but need some help determining the right mix to make the variables work.

Here is my code. Thanks very much.

ControlServer = doc_DBLocations.ColumnValues( 2 )

ControlPath = doc_DBLocations.ColumnValues( 3 )

Set db_Control = session.GetDatabase( ControlServer, ControlPath ) 

SafeRep = Evaluate ( {@DbLookup( “” : “NoCache”; “| &ControlServer& |” : “aaaTim\PreqCtrl2.nsf”; “vPlantSafety” ; “2”; 2)}, doc )

Subject: Evaluate @DBLookup not working with variables

You’re mixing up your string delimiters, using a { and then a |. You can use either but you can’t use both in the same line. Change it to:

SafeRep = Evaluate ( {@DbLookup( “” : “NoCache”; “} & ControlServer & {” : “aaaTim\PreqCtrl2.nsf”; “vPlantSafety” ; “2”; 2)}, doc )

Subject: RE: Evaluate @DBLookup not working with variables

Thanks for the help Dan.

Believe got close but still not right. With this code I get a script syntax error - ‘Unexpected: String constant’ and will not save. Seems to think I want to break up the DBLookup statement by putting a constant in the middle.

Any ideas how to tweak this to work.

Thanks again,

Tim

Subject: It Works - Needed a Plus Sign

Dan,

Thanks very much for your suggestion. Had to add ‘+’ so everything concatenated properly. Here is working code.

SafeRep = Evaluate ( {@DbLookup( “” : “NoCache”; “} + ControlServer + {” : “aaaTim\PreqCtrl2.nsf”; “vPlantSafety” ; “2”; 2)}, doc )

Subject: RE: It Works - Needed a Plus Sign

Shouldn’t need to - & works the same as plus so you must have changed something else as well. I noticed you didn’t have spaces between ControlServer and the & originally, which I changed in my version, maybe you didn’t in yours.

Either way, glad it’s working