@DbName or @DbColumn issue?

Hi,

Does anyone know of any reason why the following code would not behave as expected through a Notes 6 client?

The code does a look up to return values from another database for a keyword field…

dbname:=@RightBack(@Subset(@DbName;-1);“\”);

@DbColumn(“”:“nocache”;@Subset(@DbName;1):@Left(@Subset(@DbName;-1);dbname)+“PageCreate.nsf”;“Banners”;1)

The code has worked fine for years until now.

Any ideas would be very much appreciated.

Thanks,

Gareth

Subject: Got it to work…

here’s what I used:

REM {Lookup assignments};

dbname:=@RightBack(@Subset(@DbName;-1);“\”);

CLASS := “Notes”;

NOCACHE := “NoCache”;

CACHE := “Cache”;

REM {Server is assumed to be same as one user is working on};

SERVER := @Subset(@DbName; 1);

REM { it’s failing here};

DATABASE := @Left(@Subset(@DbName;-1);dbname)+ “employeebu.nsf”;

REM {this lines works!};

REM {database := “develop/michael/employeebu.nsf”;};

VIEW := “nickname”;

COLUMN := 1;

LookUp := @DbColumn(CLASS : CACHE; SERVER : DATABASE; VIEW; COLUMN);

@If(@IsError(LookUp); “”; LookUp)

Subject: Thanks

Thanks for all your help, I really do appreciate it.

I’ll go and try out your code.

Thanks again,

Gareth

Subject: RE: Got it to work…

Hi Michael,

You’re spot on mate. It’s definitely got something to do with working out the path within the lookup formula.

Original Code…

dbname:=@RightBack(@Subset(@DbName;-1);“\”);

@DbColumn(“”:“nocache”;@Subset(@DbName;1):@Left(@Subset(@DbName;-1);dbname)+“PageCreate.nsf”;“Banners”;1)

Working Code…

dbname:=@RightBack(@Subset(@DbName;-1);“\”);

dbname2:=@Left(@Subset(@DbName;-1);dbname)+“PageCreate.nsf”;

@DbColumn(“”:“nocache”;@Subset(@DbName;1):dbname2;“Banners”;1)

Has anyone else found this problem or know the reason why this is happening?

Thanks,

Gareth

Subject: @DbName or @DbColumn issue?

I tried your formula and get the treaded “Unable to find server” message. I’m still doing some testing with your code and here’s what I’m using to verify the dbcolumn:

REM {Lookup assignments};

CLASS := “Notes”;

NOCACHE := “NoCache”;

CACHE := “Cache”;

REM {Server is assumed to be same as one user is working on};

SERVER := @Subset(@DbName; 1);

DATABASE := “pagecreate.nsf”;

VIEW := “Banners”;

COLUMN := 1;

LookUp := @DbColumn(CLASS : CACHE; SERVER : DATABASE; VIEW; COLUMN);

@If(@IsError(LookUp); “”; LookUp)

This formula works!

Subject: @DbName or @DbColumn issue?

What is the FULL PATh to the db?

Subject: RE: @DbName or @DbColumn issue?

Thanks very much for your help Michael, it is very much appreciated.

The full path of the database is:

“Databases\cmsdev\AberdeenPrices.nsf”

The full path of the database I want to look up is:

“Databases\cmsdev\PageCreate.nsf”

Subject: Here’s what I found…

By substitututing your formula…I believe I can tell you where it’s failing.

The DATABASE line below will fail is I cut the db name off and try to add it using the + sign in the LOOKUP formula

REM {Lookup assignments};

REM {Lookup assignments};

CLASS := “Notes”;

NOCACHE := “NoCache”;

CACHE := “Cache”;

REM {Server is assumed to be same as one user is working on};

SERVER := @Subset(@DbName; 1);

DATABASE := “develop/michael/employeebu.nsf”;

VIEW := “nickname”;

COLUMN := 1;

LookUp := @DbColumn(CLASS : CACHE; SERVER : DATABASE + if add db name here,it will fail; VIEW; COLUMN);

@If(@IsError(LookUp); “”; LookUp)

Hope this helps!

Subject: RE: @DbName or @DbColumn issue?

@DbName provides the path of the database relative to the Domino data directory.

If your Domino data directory is Databases\cmsdev, then @Subset(@DbName;-1) will return an empty value, because there will be no back-slash in it. Therefore dbname will also be empty.

Subject: Then it is fairly simple…

“Databases\cmsdev\AberdeenPrices.nsf”

The full path of the database I want to look up is:

“Databases\cmsdev\PageCreate.nsf”

dbname:=@RightBack(@Subset(@DbName;-1);“\”);

REM “dbname should now = Databases\cmsdev”;

REM “so…”;

ndbname = dbname + “\PageCreate.nsf”

@DbColumn(“”:“nocache”;@Subset(@DbName;1) : ndbname; “Banners”;1)

Subject: RE: Then it is fairly simple…

Hi Bill,

Thanks, but it’s not a problem to get other code to work.

The issue is, why doesn’t this code that worked in v5 not work in v6?

I really don’t want to have to replace lots of code in the database unless I really have to. And if I do, I’d really like to know what the issue is so it’s easier to identify other problem code.

Thanks for your help,

Gareth

Subject: Sorry, my response was wrong above. Replied before coffee.

I can see no reason why your original code would fail.