
Page 1 of 3 One of the most popular widgets in Macromedia's DevNet Resource Kit Volume 4 (DRK 4) is Pollster. This "rich Internet application" implements ColdFusion templates, ColdFusion components (CFCs), Flash MX, and Flash Remoting MX to enable users to create and manage their own online polls. You can see Pollster in action on Christian Cantrell's weblog.
The Pollster demo included in DRK 4 uses a Microsoft Access database. For production servers, Macromedia recommends using PostgreSQL or upsizing the Access database to SQL Server. To spare you the hassle, I created a SQL script that generates the necessary Pollster tables on SQL Server. You'll find pollster_build.sql in this tutorial's support files at the bottom of this page.
NOTE: According to Macromedia, they did not include a build script for MySQL "because Pollster uses subselects, which are not yet supported in full releases of MySQL."
To get Pollster up-and-running on SQL Server/IIS, we have to make three key changes to the application:
Before we proceed, you should copy the Pollster application from DRK 4 into your ColdFusion web root (e.g., C:\CFusionMX\wwwroot\pollster). This way, you can revise the application without making changes to the original Microsoft Access version.
To install the Pollster tables on SQL Server, run the SQL script, pollster_build.sql, in Query Analyzer:
TIP: To uncomment lines 9-11, simply delete lines 8 and 12. Multiple-line /* SQL comments */ use forward slash-asterisk character pairs, just like JavaScript.
At this point, you should have three new tables in your SQL Server database: Polls, Options, and Responses. The SQL script generates the same structure, or schema, as the Microsoft Access database. In addition, it creates the same primary key-foreign key constraints implemented in the SQL script that accompanies the Pollster application (postgresql_build.sql).
Later on, you can repeat the steps above to create the tables on your production server. Many online control panels enable you to create new SQL Server databases yourself. If not, contact your hosting provider and ask them to create the database for you. Needless to say, make sure to note the server name, database name, login name and password of the remote SQL Server database for future reference.
TIP: To connect to remote instances of SQL Server, you need to create a new Server Alias using the Client Network Utility (Start > Programs > Microsoft SQL Server > Client Network Utility). Once you've created the Alias, you must register it using the Register SQL Server Wizard in Enterprise Manager (click Register Server on the Enterprise Manager toolbar). For more information, see Books Online (Start > Programs > Microsoft SQL Server > Books Online).
In the next step, we'll revise two of Pollster's ColdFusion components to accommodate SQL Server.
Keywords
pollster, drk, devnet resource kit, sql server, coldfusion, flash remoting, cfc