@DBLookup Problem

I am trying to perform a @DBLookup to see if the field name “User_Name” is already taken. For some reason the @DBLookup I am using is non funtional. Any suggestions?

@If(@DbLookup(“”;“mind2.xxxxxx.edu”:“career\vlb.nsf”;“logininfo”;User_Name;“User Name”) !=“”; @SetField(“valid_username”; “unavailable”); @SetField(“valid_username”;“available”));

Database - same database but i put in the information anyways to see if that would work

view: logininfo

Want to see if the “User_Name” field is in there and if so then return username column, or any column for that matter.

Subject: @DBLookup Problem

try this tmpvar:=@DbLookup(“”;“mind2.xxxxxx.edu”:“career\vlb.nsf”;“logininfo”;User_Name;“User Name”)

;

@if(@iserror(tmpvar);@SetField(“valid_username”; “unavailable”);@setfield(“Valid_username”;“available”));

Subject: @DBLookup Problem

You say you are trying to return a column, but the last argument of your call is (in quotes) “User Name”. That argument must either be an unquoted number to designate the desired column number, or a quoted string – but the string does not designate a column name! Using a quoted string for that argument means you are designating an item name (i.e., a field name) from the document that matches the key in the lookup. So, your code is trying to retrieve the item named “User Name”, but item names don’t have spaces in them – at least not normal item names created via fields in a form built in Domino Designer, anyhow.

Subject: @DBLookup Problem

To test your dblookup to see if it’s even returning a value, put it in a temp variable first and use an @prompt to display it to you (works as a down-and-dirty @function debugger).

Also, if it’s the same database, I personally do NOT put the server & database name again, because I figure it is more efficient not to, and the “”:“” cues me that it is in the same database.

nam = @DbLookup(“”;“mind2.xxxxxx.edu”:“career\vlb.nsf”;“logininfo”;User_Name;“User Name”);

@prompt([ok]; “Name Value”; nam);

@If(@DbLookup(“”;“mind2.xxxxxx.edu”:“career\vlb.nsf”;“logininfo”;User_Name;“User Name”) !=“”;

@SetField(“valid_username”; “unavailable”);

@SetField(“valid_username”;“available”));