VoiceGuide IVR Software Main Page
Jump to content

How Delete Callque Database In A Script

Recommended Posts

Hello everybody,

 

 

 

I try to delete all the CallQue table in a script.

- I am using the Query database module.

- Under "Database or ODBC source" I put C:\Program Files\VoiceGuide\data\OutDialQue.mdb where my file is located.

- Under "connect string" I put nothing

- For my query I wrote this request to delete completely the entries and DayTimeStart in my case is really 0 in all the table...

 

SELECT '*' FROM CallQue WHERE DayTimeStart='0'

 

Can somebody could please tell me what is wrong because the database won't delete (flush).

 

P.S. The entries to record some stuff in the database is bellow (it work)

-----------------------------------------------------------------------

const numero1="668,0"

const numero2="667,0"

const numero3="692,0"

const numero4="698,0"

const numero5="653,0"

'--------------------------------------------------------------------

Const script_to_execute="C:\Program Files\VoiceGuide\Scripts\Answer and Record\alarm.vgs"

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Dialer_OutDialQueAdd numero1, 0, 0, 0, "", "", 1, "", script_to_execute,"","[CustomerID]{44563}", 0, 2, 1, ""

set vg = Nothing

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Dialer_OutDialQueAdd numero2, 0, 0, 0, "", "", 1, "", script_to_execute,"","[CustomerID]{44563}", 0, 2, 1, ""

set vg = Nothing

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Dialer_OutDialQueAdd numero3, 0, 0, 0, "", "", 1, "", script_to_execute,"","[CustomerID]{44563}", 0, 2, 1, ""

set vg = Nothing

 

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Dialer_OutDialQueAdd numero4, 0, 0, 0, "", "", 1, "", script_to_execute,"","[CustomerID]{44563}", 0, 2, 1, ""

set vg = Nothing

 

 

set vg = CreateObject("VoiceGuide.CommandLink")

vg.Dialer_OutDialQueAdd numero5, 0, 0, 0, "", "", 1, "", script_to_execute,"","[CustomerID]{44563}", 0, 2, 1, ""

set vg = Nothing

Share this post


Link to post

Well sorry outside of SELECT I used

DELETE '*' FROM CallQue WHERE DayTimeStart='0'

but the effect is the same :) ... nothing is deleted

Share this post


Link to post

DayTimeStart is a number field not a string field, so your SQL statement should probably be:

 

DELETE FROM CallQue WHERE DayTimeStart=0

 

I don’t think you should be specifying '*' after DELETE either...

Share this post


Link to post

Well what you gave doesn't work but I finally found a script toto.vbs who do what I need... So Please find the details bellow of my .vbs if there is others people who have the same needs...

 

Dim objCon ' A Connection Object for database connectivity

Dim objRS ' A Recordset Object for database connectivity

Dim sProviderName ' The OLE Provider Type

Dim iCursorType ' The Cursor Type for the Recordset

Dim iLockType ' The Lock Type for the Recordset

Dim sDataSource ' The name and location of the database

Dim intCompID ' A computer ID asssigned when the computer is added to the database

Dim intRam ' The amount of RAM in the computer.

 

call subConnectionOpen

call deleteall

call subConnectionClose

 

Sub subConnectionOpen

Set objCon = CreateObject("ADODB.Connection")

Set objRS = CreateObject("ADODB.Recordset")

sProviderName = "Microsoft.Jet.OLEDB.4.0"

iCursorType = 1

iLockType = 3

sDataSource = "c:\OutDialQue.mdb"

objCon.Provider = sProviderName

objCon.Properties("Data Source") = sDataSource

objCon.Open

End Sub

 

Sub subConnectionClose

set objRS = nothing

set objCon = nothing

End Sub

 

Sub deleteall

objRS.CursorType = iCursorType

objRS.LockType = iLockType

objRS.Source = "CallQue"

objRS.ActiveConnection = objCon

objRS.Open

Do While Not objRS.EOF

objRS.delete

objRS.Update

objRS.MoveNext

Loop

objRS.Close

end sub

Share this post


Link to post

Well finally because I had lot of difficulties with the dialer I made few scripts to

-1- Delete the complete mdb access database dialer

-2- Add entries in the dialer from a scenario

 

It work very well but I'm sure it could be still improved so I would like to share that with everybody to spare lot of time to the users. (the modem is a fritz card ISDN who work very well with TTS too). Have fun!

 

 

 

-----1 DELETE THE COMPLETE DIALER DATABASE----

 

Dim objCon ' A Connection Object for database connectivity

Dim objRS ' A Recordset Object for database connectivity

Dim sProviderName ' The OLE Provider Type

Dim iCursorType ' The Cursor Type for the Recordset

Dim iLockType ' The Lock Type for the Recordset

Dim sDataSource ' The name and location of the database

 

 

call subConnectionOpen

call deleteall

'wscript.echo "DELETED"

call subConnectionClose

 

Sub subConnectionOpen

Set objCon = CreateObject("ADODB.Connection")

Set objRS = CreateObject("ADODB.Recordset")

sProviderName = "Microsoft.Jet.OLEDB.4.0"

iCursorType = 1

iLockType = 3

sDataSource = "C:\Program Files\VoiceGuide\data\OutDialQue.mdb"

objCon.Provider = sProviderName

objCon.Properties("Data Source") = sDataSource

objCon.Open

End Sub

 

Sub subConnectionClose

set objRS = nothing

set objCon = nothing

End Sub

 

Sub deleteall

objRS.CursorType = iCursorType

objRS.LockType = iLockType

objRS.Source = "CallQue"

objRS.ActiveConnection = objCon

objRS.Open

Do While Not objRS.EOF

objRS.delete

objRS.Update

objRS.MoveNext

Loop

objRS.Close

end sub

 

 

 

-----2 ADD TWO ENTRIES IN THE DIALER--------

 

Dim objCon ' A Connection Object for database connectivity

Dim objRS ' A Recordset Object for database connectivity

Dim sProviderName ' The OLE Provider Type

Dim iCursorType ' The Cursor Type for the Recordset

Dim iLockType ' The Lock Type for the Recordset

Dim sDataSource ' The name and location of the database

 

const numero1="5550065"

const numero2="5550066"

 

 

call subConnectionOpen

call addentry1

call addentry2

call subConnectionClose

 

Sub subConnectionOpen

Set objCon = CreateObject("ADODB.Connection")

Set objRS = CreateObject("ADODB.Recordset")

sProviderName = "Microsoft.Jet.OLEDB.4.0"

iCursorType = 1

iLockType = 3

sDataSource = "C:\Program Files\VoiceGuide\data\OutDialQue.mdb"

objCon.Provider = sProviderName

objCon.Properties("Data Source") = sDataSource

objCon.Open

End Sub

 

Sub subConnectionClose

set objRS = nothing

set objCon = nothing

End Sub

 

Sub addentry1

objRS.CursorType = iCursorType

objRS.LockType = iLockType

objRS.Source = "CallQue"

objRS.ActiveConnection = objCon

objRS.Open

objRS.addnew

objRS.Fields("PhoneNumber") = numero1

objRS.Fields("ActivateTime") = 501122129

objRS.Fields("DayTimeStart") = 1

objRS.Fields("DayTimeStop") =2359

objRS.Fields("DaysCallAllowed") ="MoTuWeThFrSaSu"

objRS.Fields("LineSelection") =""

objRS.Fields("Priority") =2

objRS.Fields("AnnounceMessage") ="NONE"

objRS.Fields("Script") =script_to_execute

objRS.Fields("OnAnswerMachine") ="NONE"

objRS.Fields("RV") ="none"

objRS.Fields("AnswerTimeout") =60

objRS.Fields("CallRetriesLeft") =2

objRS.Fields("DelayBetweenRetries") =120

objRS.Fields("OnNotConnected") =""

objRS.Fields("EscalationCalls") ="none"

objRS.update

objRS.Close

end sub

 

 

 

Sub addentry2

objRS.CursorType = iCursorType

objRS.LockType = iLockType

objRS.Source = "CallQue"

objRS.ActiveConnection = objCon

objRS.Open

objRS.addnew

objRS.Fields("PhoneNumber") = numero2

objRS.Fields("ActivateTime") = 501122129

objRS.Fields("DayTimeStart") = 1

objRS.Fields("DayTimeStop") =2359

objRS.Fields("DaysCallAllowed") ="MoTuWeThFrSaSu"

objRS.Fields("LineSelection") =""

objRS.Fields("Priority") =2

objRS.Fields("AnnounceMessage") ="NONE"

objRS.Fields("Script") =script_to_execute

objRS.Fields("OnAnswerMachine") ="NONE"

objRS.Fields("RV") ="none"

objRS.Fields("AnswerTimeout") =60

objRS.Fields("CallRetriesLeft") =2

objRS.Fields("DelayBetweenRetries") =120

objRS.Fields("OnNotConnected") =""

objRS.Fields("EscalationCalls") ="none"

objRS.update

objRS.Close

end sub

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
×