VoiceGuide IVR Software Main Page
Jump to content

How Can I Loop Through Query Results?

Recommended Posts

I use the Query Database module to retrieve some data from an Access database. I want to loop through the results. In other development environments, I would accomplish this with a For loop based on the number of returned rows. I have tried this with the code below, but it's not working.

 

Can you help me with the correct syntax or let me know how to accomplish this? Thanks.

 

 

set fso = CreateObject("Scripting.FileSystemObject")

set tsFile = fso.OpenTextFile("C:\LogCalls.txt", ForAppending, True)

 

for i = 1 to $RV[Get Email Addresses_RowCount]

tsFile.WriteLine "$RV[Get Email Addresses_1_" & i & "]"

next

Share this post


Link to post

This is a very similar question to the one answered recently here:

http://voiceguide.com/forums/index.php?showtopic=2620

 

In your case, have a look at this approach:

set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("C:\LogCalls.txt", ForAppending, True)

for i = 1 to $RV[Get Email Addresses_RowCount]
 sRvToRetreive ="RV[Get Email Addresses_1_" & i & "]"
 sReturnValue = vg.RvGet($RV_LINEID, sRvToRetreive)
 tsFile.WriteLine sReturnValue 
next

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×