AppConnRecord Object

Use the AppConnRecord object to manage model records.

Click a method to see more information on its use, syntax, and parameters:

Count Property

Used to get the number of elements in the record.

Syntax

object.Count

Part Description
object An AppConnRecord object

Remarks

Use the Count property to get the number of elements in a record.

Example

Dim Verastream_Session As AppConnModel
Dim strModelName, strServerName, strEntity, strAttrName, strAttrValue As String
Dim modRecord As AppConnRecord
Dim modRecordSet As AppConnRecordSet
Dim Attributes As AppConnStringMap

strModelName = "CCSDemo"
strServerName = "localhost"
Set Verastream_Session = New AppConnModel
Verastream_Session.ConnectToModel strServerName, strModelName

strEntityName = "CustInquiryPanel"
Verastream_Session.SetCurrentEntity strEntityName

strAttrName = "AcctNumber"
strAttrValue = "167439459"
Set Attributes = New AppConnStringMap
Attributes.Add strAttrName, strAttrValue
Verastream_Session.SetAttributes Attributes
    
strEntityName = "AcctTransactions"
Verastream_Session.SetCurrentEntity strEntityName

Set modRecordSet = Verastream_Session.FetchRecords
Set modRecord = modRecordSet.Item(1)
MsgBox ("Record count = " & modRecord.Count)

Verastream_Session.Disconnect
Set Verastream_Session = Nothing
Set modRecord = Nothing
Set modRecordSet = Nothing
Set Attributes = Nothing

ElementNames Property

Method used to get a list of the names of the elements in the record.

Syntax

object.ElementNames

Part Description
object An AppConnRecord object

Remarks

Use the ElementNames property to get a list of the names of the elements in a record.

Example

Dim Verastream_Session As AppConnModel
Dim strModelName, strServerName, strEntity, strAttrName, strAttrValue As String
Dim modRecord As AppConnRecord
Dim modRecordSet As AppConnRecordSet
Dim Attributes As AppConnStringMap

strModelName = "CCSDemo"
strServerName = "localhost"
Set Verastream_Session = New AppConnModel
Verastream_Session.ConnectToModel strServerName, strModelName

strEntityName = "CustInquiryPanel"
Verastream_Session.SetCurrentEntity strEntityName

strAttrName = "AcctNumber"
strAttrValue = "167439459"
Set Attributes = New AppConnStringMap
Attributes.Add strAttrName, strAttrValue
Verastream_Session.SetAttributes Attributes
Attributes.Clear
    
strEntityName = "AcctTransactions"
Verastream_Session.SetCurrentEntity strEntityName

Set modRecordSet = Verastream_Session.FetchRecords
Set modRecord = modRecordSet.Item(1)
For I = 1 To modRecord.Count
    MsgBox ("Record element names are " & modRecord.ElementNames(I))
Next

Verastream_Session.Disconnect
Set Verastream_Session = Nothing
Set modRecord = Nothing
Set modRecordSet = Nothing
Set Attributes = Nothing

FromXMLString Method

Used to set a record from an XML representation.

Syntax

object.FromXMLString(Record)

Part Description
object An AppConnRecord object
Record An XML representation of the record

Remarks

Use the FromXMLString method to set a record from an XML representation.

GetElements Method

Used to get a stringmap of the elements in the record.

Syntax

Set StringMap = object.GetElements

Part Description
object An AppConnRecord object
StringMap A AppConnStringMap of elements in name/value pairs

Remarks

Use the GetElements method to get a string map of the elements in a record. This function can be used when updating a record by getting the elements of the record, updating one or more fields, and using the elements in an update record function.

Example

Dim Verastream_Session As AppConnModel
Dim strModelName, strServerName, strEntity, strAttrName, strAttrValue As String
Dim modRecord As AppConnRecord
Dim modRecordSet As AppConnRecordSet
Dim Attributes As AppConnStringMap

strModelName = "CCSDemo"
strServerName = "localhost"
Set Verastream_Session = New AppConnModel
Verastream_Session.ConnectToModel strServerName, strModelName

strEntityName = "CustInquiryPanel"
Verastream_Session.SetCurrentEntity strEntityName

strAttrName = "AcctNumber"
strAttrValue = "167439459"
Set Attributes = New AppConnStringMap
Attributes.Add strAttrName, strAttrValue
Verastream_Session.SetAttributes Attributes
Attributes.Clear
    
strEntityName = "AcctTransactions"
Verastream_Session.SetCurrentEntity strEntityName

Set modRecordSet = Verastream_Session.FetchRecords
Set modRecord = modRecordSet.Item(1)
Set Attributes = modRecord.GetElements
MsgBox ("Record element 'Date' value is = " & Attributes.Item("Date"))
MsgBox ("Record element 'Date' value is = " & Attributes("Date"))
MsgBox ("Record element 'Date' value is = " & Attributes!Date)

Verastream_Session.Disconnect
Set Verastream_Session = Nothing
Set modRecord = Nothing
Set modRecordSet = Nothing
Set Attributes = Nothing

Item Property

Used to get an element in a record.

Syntax

object.Item(Index)

object.Item("Name")

object(Index)

object("Name")

object!Name

Part Description
object An AppConnRecord object
Index The index (starting at 1) of an element within the record. The index is the location in the record of the field relative to the other fields.
Name The name of an element in the record

Remarks

Use the Item property to get an element in a record.

Example

Dim Verastream_Session As AppConnModel
Dim I As Integer
Dim strModelName, strServerName, strEntity, strAttrName, strAttrValue As String
Dim modRecord As AppConnRecord
Dim modRecordSet As AppConnRecordSet
Dim Attributes As AppConnStringMap

strModelName = "CCSDemo"
strServerName = "localhost"
Set Verastream_Session = New AppConnModel
Verastream_Session.ConnectToModel strServerName, strModelName

strEntityName = "CustInquiryPanel"
Verastream_Session.SetCurrentEntity strEntityName

strAttrName = "AcctNumber"
strAttrValue = "167439459"
Set Attributes = New AppConnStringMap
Attributes.Add strAttrName, strAttrValue
Verastream_Session.SetAttributes Attributes
    
strEntityName = "AcctTransactions"
Verastream_Session.SetCurrentEntity strEntityName

Dim resultsStr As String
resultsStr = ""
Set modRecordSet = Verastream_Session.FetchRecords
For I = 1 To modRecordSet.Count
    Set modRecord = modRecordSet.Item(I)
    resultsStr = resultsStr & vbNewLine & modRecord.Item("Date")
Next
MsgBox resultsStr, vbOKOnly, "Dates"

Verastream_Session.Disconnect
Set Verastream_Session = Nothing
Set modRecord = Nothing
Set modRecordSet = Nothing
Set Attributes = Nothing

RecordType Property

Used to get the type of the record.

Syntax

object.RecordType

Part Description
object An AppConnRecord object

Remarks

Use the RecordType property to get type of a record. The enumeration values for AppConnRecordType are defined in the Type Library.

Return Value Record Types
0 ModelRecord
1 TableRecord

Example

Dim Verastream_Session As AppConnModel
Dim strModelName, strServerName, strEntity, strAttrName, strAttrValue As String
Dim modRecord As AppConnRecord
Dim modRecordSet As AppConnRecordSet
Dim Attributes As AppConnStringMap

strModelName = "CCSDemo"
strServerName = "localhost"
Set Verastream_Session = New AppConnModel
Verastream_Session.ConnectToModel strServerName, strModelName

strEntityName = "CustInquiryPanel"
Verastream_Session.SetCurrentEntity strEntityName

strAttrName = "AcctNumber"
strAttrValue = "167439459"
Set Attributes = New AppConnStringMap
Attributes.Add strAttrName, strAttrValue
Verastream_Session.SetAttributes Attributes
Attributes.Clear
    
strEntityName = "AcctTransactions"
Verastream_Session.SetCurrentEntity strEntityName

Set modRecordSet = Verastream_Session.FetchRecords
Set modRecord = modRecordSet(1)
MsgBox (" The record type is = " & modRecord.RecordType)

Verastream_Session.Disconnect
Set Verastream_Session = Nothing
Set modRecord = Nothing
Set modRecordSet = Nothing
Set Attributes = Nothing

ToXMLString Method

Used to get an XML representation of the record.

Syntax

XMLString = object.ToXMLString([URLDTD])

Part Description
object An AppConnRecord object
URLDTD [optional] The URL of a DTD that will be used to validate the XML
XMLString An XML representation of the record

Remarks

Use the ToXMLString method to get an XML representation of the record.

Example

Dim Verastream_Session As AppConnModel
Dim strModelName, strServerName, strEntity, strAttrName, strAttrValue As String
Dim modRecord As AppConnRecord
Dim modRecordSet As AppConnRecordSet
Dim Attributes As AppConnStringMap

strModelName = "CCSDemo"
strServerName = "localhost"
Set Verastream_Session = New AppConnModel
Verastream_Session.ConnectToModel strServerName, strModelName

strEntityName = "CustInquiryPanel"
Verastream_Session.SetCurrentEntity strEntityName

strAttrName = "AcctNumber"
strAttrValue = "167439459"
Set Attributes = New AppConnStringMap
Attributes.Add strAttrName, strAttrValue
Verastream_Session.SetAttributes Attributes
Attributes.Clear
    
strEntityName = "AcctTransactions"
Verastream_Session.SetCurrentEntity strEntityName

Set modRecordSet = Verastream_Session.FetchRecords
Set modRecord = modRecordSet(1)

MsgBox (" The record in XML format is = " & modRecord.ToXMLString)

Verastream_Session.Disconnect
Set Verastream_Session = Nothing
Set modRecord = Nothing
Set modRecordSet = Nothing
Set Attributes = Nothing