Hi all, I would like to run a SQL query against my db which returns a list of rows with a value against each row (sample below).
I assume this is done via a vbs script embedded into a Rule run every x mins. The values inserted into property bags, then returned.
I have been able to return a single value from a rule and view its change over time (performance), however getting multiple values into the property bag and returning them ive been unable to do. any help greatly appriciated.
Script sample below, key server names removed
Const adOpenStatic = 3
Const adLockOptimistic = 3
Set oAPI = CreateObject(“MOM.ScriptAPI”)
Set oBag = oAPI.CreatePropertyBag()
Set objConnection = CreateObject(“ADODB.Connection”)
Set objRecordSet = CreateObject(“ADODB.Recordset”)
“Provider=prov;Data Source=db;” & _
objRecordSet.Open “SQL query here”, _
objConnection, adOpenStatic, adLockOptimistic
apples = objRecordSet.Fields.Item(0)
oranges = objRecordSet.Fields.Item(0)
pears = objRecordSet.Fields.Item(0)
apples = apples
oranges = oranges
pears = pears