Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

SQL Result Loop

$
0
0
I am running an SQL script and can easily write results as long as there is only one result:

[ autoit ]      
FileWriteLine($TextTemplate,$adoRs.Fields(1).value & ', ' & $adoRs.Fields(2).value)

Can anyone give me any good direction on how to create a loop when the number of results is not constant? I am fairly new to autoIT and I know the following is far from correct. When I run this script it seems to be an infinite loop:

[ autoit ]      
$countBan = 0 While 1 $countBan = $countBan + 1 If $countBan < 0 Then ExitLoop WEnd While Not $adoRs.eof For $i = 0 To $countBan $ln[$i] = $adoRs.Fields(1).value $fn[$i] = $adoRs.Fields(2).value Next WEnd For $i = 0 To $countBan FileWriteLine($TextTemplate,$adoRs.$ln[$i] & ', ' & $fn[$i]) Next

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>