" /> CCP - Export to Access db with VB Script - Genesys CTI User Forum

Author Topic: CCP - Export to Access db with VB Script  (Read 2386 times)

Frank

  • Guest
CCP - Export to Access db with VB Script
« on: April 07, 2009, 09:26:44 AM »
Advertisement
Hi,

i would like to export data from CCP to an Access database. I have put the following VB Script in an Action, but it doesent work, it dont write anything in the database.



If Threshold.StatValue > 0 Then
   
    Skill_Name = "Test_Skill"

stDB = "C:\xxxxxxxxPATHxxxxxx\CCPTest.mdb"
   
      Set cnt = New ADODB.Connection
      Set rst = New ADODB.Recordset
   
      cnt.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                "Data Source=" & stDB & ";"
               
      stSQL = "UPDATE service_level_table" _
              & " SET service_level = '" & Threshold.StatValue  & "'" _
              & " WHERE skill_name = '" & Skill_Name & "';"
   
      With rst
          .CursorLocation = adUseClient
          .Open stSQL, cnt, adOpenForwardOnly, adLockReadOnly
      End With

  rst.Close
  Set rst = Nothing
  cnt.Close
  Set cnt = Nothing

Threshold.Result = True

End If


When I test the script in the "Action Creation page" i get a msg "Script tested sucessfully!".
I have also tried the script in excel VB modul, and that works great.


Does anyone now if it is posible to export to an Access database? What is wrong?