11-25-2015 05:36 AM
Hi,
I'm running into a strange issue. I need to access the modification date of my search results programmatically. that property is visible in the navigator window. When I make a list of all the properties of the elements in my datafinder search results, that property shows up. when I interrogate the datatpe, name, and other attributes of that property, I get an answer. But when I try to get to its value, I get an error telling me that this property or method is not supported by object. what's even weirder is that I'm not running into that problem with other properties. It only seems to occur with properties of the date variety. I'm very confused
Thabks in advance for the help.
Solved! Go to Solution.
11-25-2015 07:40 AM
Hi Max,
Can you load the modify date column programmatically, like this?
Set oMyResults = Navigator.Display.CurrDataProvider.ResultsList.ResultsElements Call Navigator.LoadProperty("modifyTime", oMyResults)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-25-2015 07:44 AM
Hi Brad, yes that works. I'll try to use it as a woraround, but I'm surprised that the property("modifytime").value doesn't work.
11-25-2015 07:50 AM - edited 11-25-2015 07:51 AM
Here we have a difference between the Datafinder API and the internal root API.
In case of DataFinder the date values are returned as usiTimeDispObject.
Option Explicit Dim oMyDataFinder, oMyQuery, oMyResults Set oMyDataFinder = Navigator.ConnectDataFinder("My DataFinder") Set oMyQuery = oMyDataFinder.CreateQuery(eTextQuery) oMyQuery.Text = "example.tdm" Call oMyDataFinder.Search(oMyQuery) dim rootElem : set rootElem = oMyDataFinder.Results.Item(1) Dim oMyProp, txt txt = "" For Each oMyProp in rootElem.Properties dim propVal if DataTypeDate = oMyProp.DataType then propVal = oMyProp.Value.VariantDate else propVal = oMyProp.Value end if txt = txt & oMyProp.Name & " : " & propVal & VBCRLF Next MsgBox txt
For DIAdem portal there is no indirection.
Option Explicit Dim oMyProp, txt txt = "" For Each oMyProp in data.root.Properties dim propVal propVal = oMyProp.Value txt = txt & oMyProp.Name & " : " & propVal & VBCRLF Next MsgBox txt
11-25-2015 08:03 AM
That's perfect, thanks for the help.