Promotic
WikipediaLinkedInYoutubeTwitterFacebook

RsGet - method of object PmAdo

Description:
Opens up the stored AdoRecordset object with defined identifier, that has been created previously by calling the RsOpen method.
Syntax:
RsGet(sId As String) As Object
Calling:
Set oRecordset = oDb.RsGet(sId)
Parameters:
sId(String) Unique identifier used by the PmAdo object to store the specific AdoRecordset object.
Return Values:
If exists, then returns the stored AdoRecordset object with defined identifier. If doesn't exist, then returns the value Nothing.
Note:
ADO Record object:

Depending on the specific ADO Provider it is possible, that a single row SQL query result will not be returned as AdoRecordset object containing a single record, but as a AdoRecord object (represents the single row). Není to ale typické pro nejběžněji užívané ADO Provider. The AdoRecord object is usually returned by explicit operations, when the specific AdoRecord is returned from the existing AdoRecordset object. The AdoRecord object consists of multiple AdoField objects, similar as the AdoRecordset object. The difference is that the methods for moving the position of current record are not supported (e.g. MoveFirst). In order to keep the documntation simple, it will be referred only to the commonly returned object AdoRecordset, although in some special cases the system may also return the AdoRecord object.

Example:
Obtains the AdoRecordset object with defined unique identifier ("table1") from the PmAdo object("/TestAdoDb"). It checks if no error occurs and the method returned valid AdoRecordset object. Then all records in the AdoRecordset object are checked and the values of the first column of each record are written into the INFO system.
VBScriptSelect and copy to clipboard

Dim oDb, oRs, nLastErr2
Set oDb = pMe.Pm("/TestAdoDb")
Set oRs = oDb.RsGet("table1")

If Not oRs Is Nothing Then
  oRs.MoveFirst
  Do While Not oRs.EOF
    Pm.Debug "Field=" & oRs.Fields.Item(0)
    oRs.MoveNext
  Loop
End If
PROMOTIC 9.0.0 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice