Variant & Evaluate(@DBColumn) result?

I have a strange result from the code below, the variant “lookup” ends up with a single value: “1.#INF

The Evaluate appears to work as it takes a few seconds to run the @DBColumn with no errors but the returned result is not what I expect.

I’m trying to return an array of column values and set a profile document field - are there too many records in the column for the variant datatype?

Dim s As New NotesSession

Dim formula As String

Dim mm_Db(1) As String

Dim db As NotesDatabase

Dim profDoc As NotesDocument

Dim lookup As Variant

mm_Db(0) = mmDb.Server

mm_Db(1) = Replace(mmDB.filePath, "", “\”)

formula = |@DbColumn(“”:“”;“| & mm_DB(0) & |”:“| & mm_DB(1) & |”; “MakeModelLookup”; 1);|

Set db = s.CurrentDatabase

Set profDoc = db.GetProfileDocument(“EquipQuoteProfile”)

lookup = Evaluate(formula)

profDoc.MakeLookup = lookup

Call profDoc.Save(True,False)

Cheers.

Subject: Variant & Evaluate(@DBColumn) result?

are you trying set to usual NotesDocument object?when accessing to profile document, that profile document will be cached.

(it seems to unexcept values are set.)

Subject: RE: Variant & Evaluate(@DBColumn) result?

What happens when you try this from a formula context instead of LotusScript? Is an error returned then?

It might be that the column contains too much data for a formula to return, but in that case I would expect it to be truncated. I think more likely the problem is that the column contains values that are not all the same datatype.

Subject: Variant & Evaluate(@DBColumn) result? solved

Thought I would post back on this as I managed to resolve it, just incase anyone else comes across it.

I believe it was due to the @DBColumn returning too many values. The view I was using contained equipment records with the Manufacturer in the first column and the Model in the second column. Due to there being multiple models for each manufacturer, there were many duplicate values present in the manufacturer column. I created a new view just for this agent which used a single categorised column for Manufacturer, which eliminated all the duplicates and the problem dissapeared.