Elipse Knowledgebase



Basic VBScript for Elipse E3: Lesson 7 - GetADORecordSet

Query's GetADORecordSet method returns an  ADO (ActiveX Data Object) type Recordset, resulting from the execution of the configured query.

The ADO Recordset object is used to access a chart's record in the database. It has the following properties and methods:

Properties:
BOF: Returns true if the position of the pointer is previous to the first record.
EOF: Returns true if the position of the pointer is posterior to the last record.
RecordCount: Returns the number of records in the chart.

Methods:
MoveFirst: Moves the pointer to the first record.
MoveLast: Moves the pointer to the last record.
MoveNext: Moves the pointer to the next record.
MovePrevious: Moves the pointer to the previous record.

To access the records individually, we use Fields ("FieldName") command.

Example:

set RS = Screen.Item("Query1").GetADORecordset()
for i=1 to RS.RecordCount
    Field1 = RS.Fields("Field1").Value
    Field2 = RS.Fields("Field2").Value
    Field3 = RS.Fields("Field3").Value
    MsgBox Field1 &vbTab& Field2 &vbTab& Field3
next

Exercises:

1. Insert a Database object in the project and configure it.
2. Create 3 demonstration tags and record them in the Database using the Historic object. In the Historic, set recording time to 0 seconds.
3. Insert a button on screen that when clicking records a register in the Historic. (WriteRecord)
4. Insert a query object on screen that searches the data saved by the Historic.
5. Create a button on screen that when clicking, displays every row in the Historic. Use the While command to repeat the script until it has not reached the end of the chart.



Related Articles

Attachments

Visitor Comments

No visitor comments posted. Post a comment

Post Comment for "Basic VBScript for Elipse E3: Lesson 7 - GetADORecordSet"

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.

   Name:
   Email:
* Comment:
* Enter the code below:

 

Article Details

Last Updated
28th of October, 2009

Autor
Paula Pereira Enéas

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue