Guest Guest_khalid Report post Posted 09/03/2005 07:16 AM Dear Sir, I'm create vbscript module to connect to database, I need create loop inside that VBScript module to get the sound file name form the database recordset and play it in the Play module then back again to the VBScript to get the second sound file name and play in the Play module and so on until the last record in the recordset. thanks Share this post Link to post
Guest Guest_khalid Report post Posted 09/04/2005 07:37 AM I mean: Const adOpenStatic = 3 set vg = CreateObject("VoiceGuide.CommandLink") set cn = CreateObject("ADODB.Connection") set rs = CreateObject("ADODB.Recordset") cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\data\Ads.mdb" if cn.State = 1 then set rs.ActiveConnection = cn rs.Open "SELECT TOP 1 NameField FROM AdList ", cn, adOpenStatic while Not rs.EOF then sNameField = rs.Fields("NameField").Value ' ##################################################### ' I need put script here to branch to "Play module" ' then speak the value of variable 'sNameFiled' that is I get it from database, ' after the "Play module" finished from 'text to speak', back again to this script ' then take the next value of the variable 'sNameField' to "Play module' for ' speak it as 'text to speak'.. and so on, until finish from all records I get it ' from database. (speak all result I get it from database one by one) ' ##################################################### end if end if cn.Close Set rs = Nothing Set cn = Nothing Set vg = Nothing Share this post Link to post
Guest Guest_Khalid Report post Posted 09/04/2005 07:40 AM rs.Open "SELECT TOP 5 NameField FROM AdList ", cn, adOpenStatic Share this post Link to post
SupportTeam Report post Posted 09/06/2005 11:20 AM No need to use VBScript for a simple loop like that. See attached script for an example of how to do this. (nb. script was not tested but it should be pretty close to the mark) play_list_from_db.vgs Share this post Link to post