KB-16467: Loading a query’s result into an internal tag.

Question:

How can I load a query’s result into an internal tag?

Solution:

To do so, you must use query’s GetADORecordset() method.

In the script below, the query on the main screen is executed, and the values of “DemoTag1” to “DemoTag2” are loaded into “InternalTag1″ to ” InternalTag12″ internal tags:

     Screen.Item(“Query1”).Execute(ImediateExecute)
  Set rs = Screen.Item(“Query1”).GetADORecordset()
  If rs.recordcount > 0 Then
  For aux = 1 to rs.fields.count

  Application.GetObject(“InternalTag.InternalTag” & aux).Value = rs.fields.Item(“DemoTag” & aux).Value

  Next
  End if

The query on the initial screen is:

SELECT TOP 1   Historic.DemoTag1,Historic.DemoTag2,Historic.DemoTag3,
Historic.DemoTag4,Historic.DemoTag5,Historic.DemoTag6,Historic.DemoTag7,
Historic.DemoTag8,Historic.DemoTag9,Historic.DemoTag10,Historic.DemoTag11,
Historic.DemoTag12
FROM Historic
ORDER BY E3TimeStamp DESC

NOTE: Attached to this article is a sample application developed with E3 version 3.1 Build 270.

Attachments:

KB16467.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *