I am trying to write a VBScript UFT test that gets a set of data from a table (it will be 100 records). I am only going to select one column as you can see from the query below.
SELECT TOP 100 l_Name FROM lessee
I was able to get the first record to display in a message box but I only did this as a test. What I'm trying to do now is add each record into an array so I can later loop through them to change the value of a WebEdit Textbox.
The following is my current code but I'm having a little difficulty figuring this out.
Dim DBQuery
DBQuery = "Select top 100 l_Name from lessee"
objConnection.Open "Provider=sqloledb.1;Server=TestServer;User Id=User;Password=Test123;Database=DBTest"
objRecordSet.Open DBQuery,objConnection
' Return the Result Set '''
For Each element In ObjRecordset.Fields.Item
Value = objRecordSet.fields.item(element)
MsgBox Value
Next
' Release the Resources '''
objRecordSet.Close
objConnection.Close
Set objConnection = Nothing
Set objRecordSet = Nothing
I was assuming looping through the returned records would work.