Guest Chrisksyeung Report post Posted 01/03/2020 03:52 AM Dear Sir I have already create below code to record the staff ID for attendence , Can I query the sql to output staff name ? Type=Run VB Script DispSize=69 Txt=Save entered data to a file using VBScript VbsFileToRun= VbsWait=1 VbScript= Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 set fso = CreateObject("Scripting.FileSystemObject") set tsFile = fso.OpenTextFile("c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRattendence.txt", ForAppending, True) If $RV_HH > 12 Then ihh =right("0" &cstr($RV_HH - 12),2) tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD PM " & ihh & ":$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & vbTab & "$RV[GetID]" Else tsFile.WriteLine "20$RV_YY/$RV_MM/$RV_DD AM $RV_HH:$RV_NN:$RV_SS" & vbTab & "$RV_CIDNUMBER" & VbTab & "$RV[GetID]" End If tsFile.Close set tsFile = Nothing set fso = Nothing VbsHoldPlay= on {success} goto [ThankA] on {fail} goto [ThankA] on {timeout 0} goto [ThankA] Position=63,365 [OLD Save Data to File_18] Type=Run Program DispSize=69 Txt=Echo the entered data to a file. This DOS Command line approach will result in the saved data being mangled if more the one line writes to the file at precisely the same time. ProgramToRun=command.com /c echo $RV[GetID] >> c:\Program Files\VoiceGuide\Scripts\Meter Reading\IVRAttendence.txt RunHoldPlay= Share this post Link to post
SupportTeam Report post Posted 01/03/2020 06:40 AM Have you tried using a Database Query type module to retrieve the staff name? More information on Database Query module: https://www.voiceguide.com/vghelp/source/html/moddbquery.htm The Database Query module will create the RVs that store results of your query, and you can then use those $RVs in your VBScript module that appends data to a text file. Share this post Link to post
Guest Chrisksyeung Report post Posted 01/04/2020 11:29 PM dear sir since the staff I'd take from IVR text file as above script. how to take ID from the text to query SQL. on the other hand . can I query excel file Share this post Link to post
SupportTeam Report post Posted 01/05/2020 12:44 AM Quote since the staff I'd take from IVR text file as above script. how to take ID from the text to query SQL. Do you want to read the name information in from text file? It's possible to use the ODBC driver "Microsoft Text Driver (*.txt; *.csv)" to do that, but this requires that the rest of the Connection String be correctly specified to match your text file format. Its possible, but its simpler to just put your data in a database and read from there. For small systems you can even use MS Access as the database. Quote can I query excel file Please see the "Microsoft Excel Example" at the bottom of the Database Query module Help file entry: https://www.voiceguide.com/vghelp/source/html/moddbquery.htm Share this post Link to post