Forum Discussion
Philip_Baird
12 years agoCommunity Hero
Hi Veronica
From your example, you seem to be iterating through the Drivers recordset but not actually setting anything from the Driver.
You will need to use the DDT::CurrentDriver::Value() method to access each field and assign it as appropriate, as such:
Sub CurDriverExample
' Creates a driver
Call DDT.ExcelDriver("C:\MyFile.xls", "Sheet1")
' Iterates through records
While Not DDT.CurrentDriver.EOF()
' Gets a value from the storage and posts it to the log
' Instead of logging, set the value of a Project Variable to be DDT.CurrentDriver.Value(0)
' Something like Project.Variables.questionTitle = DDT.CurrentDriver.Value(0)
Log.Message(DDT.CurrentDriver.Value(0))
DDT.CurrentDriver.Next()
WEnd
' Closes the driver
DDT.CloseDriver(DDT.CurrentDriver.Name)
End Sub