VoiceGuide IVR Software Main Page
Jump to content

New To Voiceguide

Recommended Posts

Hi all im new to VoiceGuide and currently evaluating it. Im running code as below VBScript to perform a lookup on a dabase table.

 

Set vgoCommandLink = CreateObject("vgServices.CommandLink")
Set conConnection = CreateObject("ADODB.Connection")
Set recRecordSet = CreateObject("ADODB.Recordset")
    
' Open connection to the database
conConnection.Open "Driver={SQL Server};Server=RFSQL1;Database=RFLIVE;Uid=sa;Pwd=password;"
        
' Sql to execute
strSQL = "SELECT Name FROM Engineers WHERE EngineerId = 1661"
    
' Get a recordset of data
recRecordSet.Open strSQL, conConnection
    
If Not (recRecordSet.EOF) Then
   EngineerName = recRecordSet.Fields(0).Value
End If

' Return success or failed code    
vgoCommandLink.Run_ResultReturn $RV_LINEID, "[EngineerName]{" & EngineerName & "}"
    
Set vgoCommandLink = Nothing
Set cmdCommand = Nothing
Set conConnection = Nothing
Set recRecordSet = Nothing

 

This executes fine the next box is an evaluator to check if a string was returned the expression to evaluate is $RV[EngineerName] I have the following paths

 

on {true} goto [PlayEngineerName]

on {false} goto [PlayEngineerNotFound]

 

and I have ticked 'Store results in log file' to check if the script above is working. In the log file the result is shown but in the evaluation on false only ever gets executed. What am I doing wrong?

 

Also can you get multiple results from a script into the $RV? I have tried RvSet in the script but didn't seem to work

 

 

Many thanks

 

Andy

Share this post


Link to post

I see that you need to place quotes around as its a text variable.

 

Thanks

 

Andy

Share this post


Link to post

Yes, quotes are needed in the Evaluate Expression module if the $RV is a string.

 

Please let us know if you have any other questions.

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
×