COM - dpQuery()

Queries values of data point attributes with the aid of SQL statements.

Synopsis

HRESULT dpQuery([in] BSTR sQuery, [out] VARIANT *avResult);

Parameters

Parameter Description
sQuery SQL statement.
avResult Result.

Description

Returns the values of data point attributes that can be queried with the aid of SQL statements. The values are written to an array of arrays.

EXAMPLE

(See ComSample.xls, CComSample)

Public Sub dpQuery()
Dim sQuery As String
Dim avResult As Variant
Dim i As Integer, j As Integer
Dim s As String
sQuery = "SELECT '_online.._value', '_online.._stime' FROM
'ExampleDP*' WHERE _ELC = DPEL_FLOAT"
moComManager.dpQuery sQuery, avResult
For i = 0 To UBound(avResult)
s = ""
For j = 0 To UBound(avResult(i))
If Not (i = 0 And j = 0) Then
s = s & avResult(i)(j) & vbTab
End If
Next j
Debug.Print s
Next i
End Sub

Assignment

COM

See also

Basics SQL in Control