Forum Discussion
4 Replies
- tristaanogreEsteemed Contributor
Why do you need to use an ADO connection? What are you intending to do? If you're looking at doing a data driven script, simply use the DDT.CSVDriver object.
- Krishna_KumarContributor
Requirement is to compare the CSV file with the DB values.
So though of using same query to retrieve the data.
Regards,
Krishna
- tristaanogreEsteemed Contributor
I wouldn't ready the file via an SQL query. I've done this in the past. Use aqFile.OpenTextFile (https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfile/opentextfile.html) to open the file for reading. Then simply use the ReadLine method to read each line of the file in as you loop through the record set from your DB query. You can then use, for the line itself, the aqString.GetListItem(https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqstring/getlistitem.html) and other supporting methods to get the particular fields out of the line of the CSV file.
Alternatively... you could still use DDT.CSVDriver to open the CSV file and then, within a loop based upon the resulting DDT object, compare fields and rows as you loop through.