Micro Focus QTP (UFT) Forums
Problem with storing value in DataTable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Problem with storing value in DataTable (/Thread-Problem-with-storing-value-in-DataTable)



Problem with storing value in DataTable - Parke - 10-01-2008

OS = XP
SP = 2
QTP = 9.2.0.0
addins = ActiveX
Working with a windows application
Setting for one iteration

The following code is not writing to a DataTable

Code:
DataTable.SetCurrentRow(1)
DataTable("Active",dtLocalSheet) = "ON"
DataTable.Value("Active",dtLocalSheet) = "ON"

DataTable.Value("Active",dtGlobalSheet) = "ON"
DataTable.Value(1,dtGlobalSheet) = "ON"
=================
The following code displays the value in the column = "Restatement" so the DataTable dtLocalSheet is being seen. If I change the "Active" to "Active1", an error occurs letting me know the column name is not present.

Code:
val = DataTable("Restatement", dtLocalSheet)
msgbox ("Restatement = " & val)

I must be doing something silly and any help in writing to a DataTable would be appreciated.


RE: Problem with storing value in DataTable - Parke - 10-02-2008

Found my mistake. Data going into the Run-Time Data Table and I was expecting the "static" table.

Now I just need to figure how to export the data from the Run-Time Data Table.

Thanks


RE: Problem with storing value in DataTable - somisays - 10-02-2008

Hi,
Use DataTable.Export or
DataTable.ExportSheet to export the data in the runtime dataTable.


RE: Problem with storing value in DataTable - Parke - 10-02-2008

Done.

Thanks.