I have R5 code that I have used for quite some time that uses the view collection instance of GetAllEntriesByKey. In one case I use a multi-valued key of two values and the other one I use three keys.
It appears that ND6.5 still functions with two keys but does not like three (or maybe more) keys. You receive the “Object variable not set” error. However when using debugger, you can see the values assigned to the keys. I find nothing in the fix list on this yet. Anybody else having trouble with this?
Subject: GetAllEntriesByKey - Multiple Keys Problem
What happens if you temporarily eliminate the first key (and view column) and just use the remaining two keys? If your theory is correct then the lookup should be successful. If the lookup fails then there is a problem with the key itself.
After a little more testing and investigation on the view names it appears that the issue was not related to the multiple keys in view.GetAllEntriesByKey(key,True), but rather boils down to the use of an _ (underscore) in a view name. I used the view name All Ideas_NotImp (this is All(space)Ideas(underscore)NotImp ) for one of my look-up views for the three key button and the view name All IdeasImp for the other look-up view (I do two look-up in one search). As you know, Notes (at least R5) thinks the _ is the hotkey indicator for the view when used in a view name (in this case making N a hotkey). If in a R5 client if you use the view.Name property in a MessageBox to obtain the view name after the Set view command line you will obtain the name All Ideas_NotImp (the actual name of the view) for both a set view command of Set view = db.GetView(“(All Ideas_NotImp)”) or Set view = db.GetView(“(All IdeasNotImp)”). R5 apparently looks at the _ as the hotkey indicator and does not care if it is in the GetView command or not. R5 will equate the two commands to the same view name.
When using the above test on a R6.5 client however, you will receive a Object Variable Not Set error when using the Set view = db.GetView(“(All IdeasNotImp)”). When using the Set view = db.GetView(“(All Ideas_NotImp)”) command, you will have a successful run of the code.
I don’t know if this is a bug in R6.5 or a fix of bug that was in R5.0.10, but in either case I know what I have to do to fix my databases.
I have had this problem if one or more of the keys are a number. I had to convert all key columns in the view to text and convert the keys to text to get it to work. Just a thought.
Thanks but the keys are all text values. The main point is that it works fine in R5 with both 2 or 3 in the multi-value key. ND6 seems to only like 2 keys. I can look at the same db with a 5 client and all is well with 2 or 3 keys, but six only likes 2 keys. The code is exactly the same for both with the exception of the additional key in the one. Also the de-bugger shows the values for all components of the key, but the client thinks one is not set.Tim