DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

datafinder results date property value inaccessible through script

Solved!
Go to solution

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.

0 Kudos
Message 1 of 5
(4,292 Views)

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

0 Kudos
Message 2 of 5
(4,287 Views)

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.

0 Kudos
Message 3 of 5
(4,285 Views)
Solution
Accepted by topic author MaxLek

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
Message 4 of 5
(4,281 Views)

That's perfect, thanks for the help.

0 Kudos
Message 5 of 5
(4,276 Views)