How to Export Voting Results
In this topic we will demonstrate how to export voting
results from the Voting service.
In the Voting service you can set the options for automatic exporting of voting results in real-time. In this sample we will export voting results to a Microsoft Access database and we will use the voting.asp web script file to publish the voting results to the web.
Files used in this sample are located in the folder:
C:\Program Files\CodeSegment\SMS Studio\Samples\VotingService\Export
How to run this sample
- Create a new ODBC Data Source and set its name to SMS Voting Database. See How to Create an ODBC Data Source for detailed instructions.
- Open Windows Explorer and locate the CreateTables.vbs file. Double-click on this file to run the script. When asked for the name of the Data Source enter SMS
Voting Database, and when asked for the table name enter Voting. A new table with the specified name will be created in the database.
- In SMS Studio open a Voting service, preferably
ABCD Voting described in this Tutorial.
- Click the Setup button on the main toolbar to display the
Voting Setup dialog.
- In the Export tab enter the following parameters:
Type: ODBC Data Source
Period: 10 seconds
Data Source: SMS Voting Database
Table name: Voting
- Click the OK button to close the Voting Setup dialog.
- The exporting of voting results will now start. Make sure that the Voting service is started and is receiving votes from the emulator connection.
- To see the exported voting results, open the database file and explore its tables.
Publishing voting results to the web
- To publish voting results to the web, you first need to setup a web server on your computer. See How to Setup a Web Server for detailed instructions.
- Copy the voting.asp file to
a folder accessible by your web server (e.g.
C:\Inetpub\wwwroot\smsstudio).
- You can view exported voting results from this computer by using the
following link http://localhost/smsstudio/voting.asp.
- To view exported results from a remote location use the link similar to this:
http://your.domain.name/smsstudio/voting.asp or
http://your.IP.address/smsstudio/voting.asp.
- To refresh the results, press the
F5 key.
Related topics
Exporting Voting Results