VoiceGuide IVR Software Main Page
Jump to content

Vb Script Not Returning Values In Rs

Recommended Posts

Hello,

We have recently purchase 4 port board enterprise license from you and making this test program.

 

I need help in this script urgently.

 

UsrPhone_no corresponds to $RV_CIDNUMBER. I have it stored in Restult variable.

 

I am getting SQL properly and when I run this script in SQL Query Analyzer, I am getting result.

 

I have to pass number back to SQL and get Unique ID back from DB. I have worked on ASP pages extensivly so I am familier with VB Script too.

 

Please advice what I am doing wrong, it is urgent.

 

Thanks in advance.

Regards

Alok

 

VB Script below:

 

Dim cn

Dim rs

Dim sSQL

Dim conStr

 

set vg = CreateObject("VoiceGuide.CommandLink")

set cn = CreateObject("ADODB.Connection")

set rs = CreateObject("ADODB.Recordset")

 

conStr = "Provider=SQLOLEDB.1;Persist Security Info=False;" _

& " Data Source=MHIVR;" _

& " Initial Catalog=MHungry; User ID=Alok;" _

& " Password=Alok123"

 

cn.Open conStr

 

if cn.State <> 1 then

vg.RvSet $RV_LINEID, "Usr_ID", 0

vg.Run_ResultReturn iLineId, "fail"

set rs = Nothing

set cn = Nothing

WScript.Quit

end if

 

sSQL = "SELECT TOP 1 Usr_ID FROM UsrPhone WHERE UsrPhone_No = '$RV[usrPhone_No]'"

 

vg.RvSet $RV_LINEID, "csSQL", sSQL

 

set rs = cn.Execute(sSQL)

 

if rs.RecordCount <= 0 then

rs.Close

vg.RvSet $RV_LINEID, "Usr_ID", -1

else

vg.RvSet $RV_LINEID, "Usr_ID", rs.Fields("Usr_ID").Value

rs.Close

end if

 

cn.Close

set rs = Nothing

set cn = Nothing

set vg = Nothing

WScript.Quit

Share this post


Link to post

I assume that you are getting rs.RecordCount <= 0 as a result?

 

Best for you to use the error reporting functions within ADODB to see what error is being returned for you (if that's where the problems lies).

 

This is more of an MS ADODB programming question rather then a VoiceGuide related question...

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
×