bwenzel@cleartel.com Report post Posted 10/12/2006 08:19 PM One other question I forgot to post..... We have a "Get Numbers" module that on success goes to a vbscript similar to the script below. The get numbers module is named OS 13-6. Once every 20 calls we receive a vbscript error that the syntax is incorrect. The syntax is incorrect because it not passing the OS 13-6 parameter so the line looks like this "CmdSP.Parameters.Append CmdSP.CreateParameter("@phone", adVarChar, adParaminput, 12, )" The call is dropping because the last param is blank. Our get numbers module only accepts 5-10 digits. On failure it goes back to itself "OS 13-6". On success it goes to the vbscript. On timeout it goes to a separate menu. Could someone please explain why it would not pass the variable at times. Also, if a situation like this occurs how to handle the error. We are also looking into error handling on our databases. Example, If a database is down and the vbscript receives an error, move to a module playing a wav file "our database is down at the moment, please retry your call again later". The ISNULL() function I have in there doesnt get used because of the syntax error before running. After we buy the additional 4 48 line licenses we will have close to 20,000 calls hitting this script a day. We are trying to close all the holes currently in the system. Thanks for all your help. set CmdSP = CreateObject("ADODB.Command") set vg = CreateObject("VoiceGuide.CommandLink") if ISNULL($RV[OS 13-6]) Then vg.RvSet $RV_LINEID, "valid", 2 Else CmdSP.ActiveConnection = "Provider=SQLOLEDB;Server=xxxxxxx;UID=xxxxx;PWD=xxxxx;Database=xxxxxxxx" 'CmdSP.CommandText = "dbo.IVR_MACOrders" CmdSP.CommandText = "dbo.IVR_Orders" CmdSP.CommandType = 4 CmdSP.Parameters.Append CmdSP.CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 4) CmdSP.Parameters.Append CmdSP.CreateParameter("@phone", adVarChar, adParaminput, 12, $RV[OS 13-6]) Set adoRS = CmdSP.Execute valid = adoRS.Fields(0).Value vg.RvSet $RV_LINEID, "valid", valid Share this post Link to post
SupportTeam Report post Posted 10/13/2006 12:03 AM I assume that the reason why the $RV[OS 13-6] is not holding any value is because caller did not enter any digits while in module [OS 13-6] - either by not pressing any key or by only pressing "#" (or perhaps "*"). If something was entered the RV would be holding that information - there are no known problems with RVs 'loosing' data assigned to them. The way to design VBScripts to guard against empty RV's causing syntax problems is to either surround them in quotes to force them to be strings (would result in an empty string if that RV does not hold a value) or by not directly using them in places where replacement with a blank would cause a syntax error and instead using a variable which gets set to the RV value beforehand. That way there is no syntax error and the check for whether RV holds any data can be made earlier in the script and the appropriate action taken if it doe not hold a value. Another alternative is to have Evaluate Expression modules before the Run VBScript module checking to see if some data is assigned to the RVs used in the VBScript. That way the VBScript would not even get to run if RVs of interest have not data assigned to them. Try changing the VBScript to something more along these lines (changes in bold): set CmdSP = CreateObject("ADODB.Command") set vg = CreateObject("VoiceGuide.CommandLink") strOS136 = "$RV[OS 13-6]" if strOS136 = "" Then vg.RvSet $RV_LINEID, "valid", 2 Else iOS136 = CInt(strOS136) CmdSP.ActiveConnection = "Provider=SQLOLEDB;Server=xxxxxxx;UID=xxxxx;PWD=xxxxx;Database=xxxxxxxx" 'CmdSP.CommandText = "dbo.IVR_MACOrders" CmdSP.CommandText = "dbo.IVR_Orders" CmdSP.CommandType = 4 CmdSP.Parameters.Append CmdSP.CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 4) CmdSP.Parameters.Append CmdSP.CreateParameter("@phone", adVarChar, adParaminput, 12, iOS136) Set adoRS = CmdSP.Execute valid = adoRS.Fields(0).Value vg.RvSet $RV_LINEID, "valid", valid Share this post Link to post