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

  1. 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.
  2. 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.
  3. In SMS Studio open a Voting service, preferably ABCD Voting described in this Tutorial.
  4. Click the Setup button on the main toolbar to display the Voting Setup dialog.
  5. In the Export tab enter the following parameters:
    Type: ODBC Data Source
    Period: 10 seconds
    Data Source: SMS Voting Database
    Table name: Voting
  6. Click the OK button to close the Voting Setup dialog.
  7. The exporting of voting results will now start. Make sure that the Voting service is started and is receiving votes from the emulator connection.
  8. To see the exported voting results, open the database file and explore its tables.

Publishing voting results to the web

  1. 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.
  2. Copy the voting.asp file to a folder accessible by your web server (e.g. C:\Inetpub\wwwroot\smsstudio).
  3. You can view exported voting results from this computer by using the following link http://localhost/smsstudio/voting.asp.
  4. 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.
  5. To refresh the results, press the F5 key.

Related topics

Exporting Voting Results

 

Copyright © 2002-2007 CodeSegment. All rights reserved.

   www.codesegment.com